From: Adam Dickmeiss Date: Sat, 5 Oct 2013 14:26:33 +0000 (+0200) Subject: GDU: if decode fails in assignment, reset m_gdu ptr X-Git-Tag: v1.5.1~3 X-Git-Url: http://git.indexdata.com/?p=yazpp-moved-to-github.git;a=commitdiff_plain;h=3a9240aceaa70f89b0a6bba3769dc9a9c8f45f1b GDU: if decode fails in assignment, reset m_gdu ptr This fixes a SEGV that could otherwise happen. --- diff --git a/src/gdu.cpp b/src/gdu.cpp index fb87251..467ded2 100644 --- a/src/gdu.cpp +++ b/src/gdu.cpp @@ -44,7 +44,8 @@ void GDU::base(Z_GDU *gdu, ODR encode) char *buf = odr_getbuf(encode, &len, 0); odr_setbuf(m_decode, buf, len, 0); - z_GDU(m_decode, &m_gdu, 0, 0); + if (!z_GDU(m_decode, &m_gdu, 0, 0)) + m_gdu = 0; } odr_destroy(encode); }