projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8418a9a
)
* StrBufPlain(): don't access pointers before we check them
author
Wilfried Göesgens
<willi@citadel.org>
Thu, 6 May 2010 18:43:10 +0000
(18:43 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Thu, 6 May 2010 18:43:10 +0000
(18:43 +0000)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index d8ff554d708febafb8e13e6221f2384a8b8b5511..b3c3fefb9697effc0026eaac402da5cbe1407fb4 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-422,7
+422,7
@@
StrBuf* NewStrBufPlain(const char* ptr, int nChars)
*/
int StrBufPlain(StrBuf *Buf, const char* ptr, int nChars)
{
- size_t Siz
= Buf->BufSize
;
+ size_t Siz;
size_t CopySize;
if (Buf == NULL)
@@
-431,6
+431,9
@@
int StrBufPlain(StrBuf *Buf, const char* ptr, int nChars)
FlushStrBuf(Buf);
return -1;
}
+
+ Siz = Buf->BufSize;
+
if (nChars < 0)
CopySize = strlen(ptr);
else