From 1182009fddf871b514762d6f26a01e29de5d54d2 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Fri, 4 Jan 2002 21:31:13 +0000 Subject: [PATCH] Fixed hang/crash for some mails --- goldlib/gmb3/gmosmb1.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/goldlib/gmb3/gmosmb1.cpp b/goldlib/gmb3/gmosmb1.cpp index cb01a85..3cc20eb 100644 --- a/goldlib/gmb3/gmosmb1.cpp +++ b/goldlib/gmb3/gmosmb1.cpp @@ -451,11 +451,14 @@ common: msg->txt = (char *)throw_realloc(msg->txt, txt_len+outlen); lzh_decode(inbuf, smsg.dfield[i].length - l, (uchar *)(msg->txt+txt_len-1)); throw_xfree(inbuf); - } else { + } + else if(l < smsg.dfield[i].length) { outlen = smsg.dfield[i].length - l; msg->txt = (char *)throw_realloc(msg->txt, txt_len+outlen); fread(msg->txt+txt_len-1, smsg.dfield[i].length - l, 1, data->sdt_fp); } + else + outlen = 0; txt_len+=outlen; msg->txt[txt_len-1] = NUL; break;