* fix off by one in buffer size
authorWilfried Göesgens <willi@citadel.org>
Fri, 9 Oct 2009 19:27:56 +0000 (19:27 +0000)
committerWilfried Göesgens <willi@citadel.org>
Fri, 9 Oct 2009 19:27:56 +0000 (19:27 +0000)
libcitadel/lib/stringbuf.c

index 5b4a2090778ac783c6e48da262794ca030eb4203..e16d806187cfca90722a2907bc2b8b2fe17d2803 100644 (file)
@@ -1671,7 +1671,7 @@ int StrBufTCP_read_line(StrBuf *buf, int *fd, int append, const char **Error)
                        break;
                if (buf->buf[len] != '\r')
                        len ++;
-               if (len >= buf->BufSize) {
+               if (len + 2 >= buf->BufSize) {
                        buf->BufUsed = len;
                        buf->buf[len+1] = '\0';
                        IncreaseBuf(buf, 1, -1);