projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae3fc62
)
* StrBufPlain(): secure input arguments; don't strlen(NULL)
author
Wilfried Göesgens
<willi@citadel.org>
Tue, 23 Mar 2010 22:19:22 +0000
(22:19 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Tue, 23 Mar 2010 22:19:22 +0000
(22:19 +0000)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index be4da4eb4e90c6b3cbf48fd70c098d3b2500be7a..b96f227697baa79bae078dcf18ce13a23bfbdaba 100644
(file)
--- 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