From: Adam Dickmeiss Date: Fri, 28 Sep 2012 12:26:09 +0000 (+0200) Subject: multi: Fix check for opt Records in present response X-Git-Tag: v1.3.47~14 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=a59a52927e5ee439e086f612b7752ab7e6808150;p=metaproxy-moved-to-github.git multi: Fix check for opt Records in present response A SEGV could occur if a target did not return records and no diagnostics. --- diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index 4eb1988..ccefccf 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -887,7 +887,7 @@ void yf::Multi::Frontend::present(mp::Package &package, Z_APDU *apdu_req) nprl->records[i] = (Z_NamePlusRecord*) odr_malloc(odr, sizeof(Z_NamePlusRecord)); int inside_pos = jit->m_pos - jit->m_start; - if (inside_pos >= b_resp->records-> + if (!b_resp->records || inside_pos >= b_resp->records-> u.databaseOrSurDiagnostics->num_records) break; *nprl->records[i] = *b_resp->records->