]> code.citadel.org Git - citadel.git/commitdiff
* another try to fix this off by one
authorWilfried Göesgens <willi@citadel.org>
Fri, 14 Nov 2008 07:50:30 +0000 (07:50 +0000)
committerWilfried Göesgens <willi@citadel.org>
Fri, 14 Nov 2008 07:50:30 +0000 (07:50 +0000)
libcitadel/lib/stringbuf.c

index 49dbd4e06d97df62aea9b8ad45ad7cf6f3d96eea..2bf49068f85644b723ceaae96ed30cc2cc749cb7 100644 (file)
@@ -350,8 +350,8 @@ void StrBufAppendBufPlain(StrBuf *Buf, const char *AppendBuf, long AppendSize, s
        else
                aps = AppendSize - Offset;
 
-       if (Buf->BufSize < Buf->BufUsed + aps)
-               IncreaseBuf(Buf, (Buf->BufUsed > 0), Buf->BufUsed + aps);
+       if (Buf->BufSize < Buf->BufUsed + aps + 1)
+               IncreaseBuf(Buf, (Buf->BufUsed > 0), Buf->BufUsed + aps + 1);
 
        memcpy(Buf->buf + Buf->BufUsed, 
               AppendBuf + Offset,