From a59a52927e5ee439e086f612b7752ab7e6808150 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 28 Sep 2012 14:26:09 +0200 Subject: [PATCH] multi: Fix check for opt Records in present response A SEGV could occur if a target did not return records and no diagnostics. --- src/filter_multi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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-> -- 1.7.10.4