From: Adam Dickmeiss Date: Mon, 27 Jul 2015 11:35:59 +0000 (+0200) Subject: Fix bad HTTP request causes a crash PAZ-1012 X-Git-Tag: v1.11.3~4 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=e196499f3533620b05459968ad8d5a074b1e1c89;p=pazpar2-moved-to-github.git Fix bad HTTP request causes a crash PAZ-1012 --- diff --git a/src/http.c b/src/http.c index 8a833c0..e3d05dc 100644 --- a/src/http.c +++ b/src/http.c @@ -840,13 +840,15 @@ void http_send_response(struct http_channel *ch) struct http_buf *hb; yaz_timing_stop(ch->yt); - yaz_log(YLOG_LOG, "Response: %6.5f %d %s%s%s ", - yaz_timing_get_real(ch->yt), - iochan_getfd(ch->iochan), - ch->request->path, - *ch->request->search ? "?" : "", - ch->request->search); - + if (ch->request) + { + yaz_log(YLOG_LOG, "Response: %6.5f %d %s%s%s ", + yaz_timing_get_real(ch->yt), + iochan_getfd(ch->iochan), + ch->request->path, + *ch->request->search ? "?" : "", + ch->request->search); + } assert(rs); hb = http_serialize_response(ch, rs); if (!hb)