From 82b21829b870f2347c6cf57ab61459c4f220b62b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 2 Oct 2013 15:45:19 +0200 Subject: [PATCH] Fix SEGV for decoding invalid SRU requests Incorrect reference to union (was explain response rather than search response). --- src/sru_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sru_util.cpp b/src/sru_util.cpp index da9aaa4..cf620bc 100644 --- a/src/sru_util.cpp +++ b/src/sru_util.cpp @@ -251,10 +251,10 @@ Z_SRW_PDU * mp_util::decode_sru_request(mp::Package &package, // closing connection if we did not ... if (0 == yaz_sru_decode(http_req, &sru_pdu_req, soap, odr_de, &charset, - &(sru_pdu_res->u.response->diagnostics), - &(sru_pdu_res->u.response->num_diagnostics))) + &(sru_pdu_res->u.explain_response->diagnostics), + &(sru_pdu_res->u.explain_response->num_diagnostics))) { - if (sru_pdu_res->u.response->num_diagnostics) + if (sru_pdu_res->u.explain_response->num_diagnostics) { //sru_pdu_res = sru_pdu_res_exp; package.session().close(); -- 1.7.10.4