From 3a9240aceaa70f89b0a6bba3769dc9a9c8f45f1b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 5 Oct 2013 16:26:33 +0200 Subject: [PATCH] GDU: if decode fails in assignment, reset m_gdu ptr This fixes a SEGV that could otherwise happen. --- src/gdu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 1.7.10.4