From 90708d108be2fe4e149fcd21f6bffea585fc3272 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 5 Aug 2002 09:47:52 +0000
Subject: [PATCH] extend qwkbuf length to 129 for null-terminator (fix for
 strlen() call on truncated kludge lines).

---
 src/sbbs3/qwktomsg.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/qwktomsg.cpp b/src/sbbs3/qwktomsg.cpp
index f5d78d9373..cb531fc123 100644
--- a/src/sbbs3/qwktomsg.cpp
+++ b/src/sbbs3/qwktomsg.cpp
@@ -44,7 +44,7 @@
 bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
 	, uint touser)
 {
-	char	str[256],*body,*tail,col=0,lastch=0,*p,*lzhbuf,qwkbuf[128];
+	char	str[256],*body,*tail,col=0,lastch=0,*p,*lzhbuf,qwkbuf[129];
 	uint 	i,j,k,lzh=0,storage,skip=0;
 	ushort	xlat;
 	long	l,bodylen,taillen,length;
@@ -117,6 +117,7 @@ bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
 		strlwr(str);
 		msg.idx.to=crc16(str); }
 
+	memset(qwkbuf,0,sizeof(qwkbuf));
 	fread(qwkbuf,1,128,qwk_fp);
 
 	if(useron.rest&FLAG('Q') || fromhub) {      /* QWK Net */
-- 
GitLab