From c271eb1db3286cd6c309f2cde33dc90d7c3c4dfe Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 2 Aug 2013 14:21:54 +0200 Subject: [PATCH] rewrite: do not even compare content types, if we don't have any the regex_match caused a segfault if we had no content-type in the headers. --- src/filter_http_rewrite.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/filter_http_rewrite.cpp b/src/filter_http_rewrite.cpp index 6cdc57c..58243bf 100644 --- a/src/filter_http_rewrite.cpp +++ b/src/filter_http_rewrite.cpp @@ -275,6 +275,10 @@ void yf::HttpRewrite::Phase::rewrite_body( { if (*content_len == 0) return; + if (!content_type) { + yaz_log(YLOG_LOG, "rewrite_body: null content_type, can not rewrite"); + return; + } std::list::const_iterator cit = content_list.begin(); for (; cit != content_list.end(); cit++) { -- 1.7.10.4