From c2f44e5fd280c1f926cab1d44ccdd01b64d5375e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 23 Mar 2010 22:19:22 +0000 Subject: [PATCH] * StrBufPlain(): secure input arguments; don't strlen(NULL) --- libcitadel/lib/stringbuf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index be4da4eb4..b96f22769 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -425,6 +425,12 @@ int StrBufPlain(StrBuf *Buf, const char* ptr, int nChars) size_t Siz = Buf->BufSize; size_t CopySize; + if (Buf == NULL) + return -1; + if (ptr == NULL) { + FlushStrBuf(Buf); + return -1; + } if (nChars < 0) CopySize = strlen(ptr); else -- 2.39.2