From e196499f3533620b05459968ad8d5a074b1e1c89 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 27 Jul 2015 13:35:59 +0200 Subject: [PATCH] Fix bad HTTP request causes a crash PAZ-1012 --- src/http.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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) -- 1.7.10.4