summaryrefslogtreecommitdiff
path: root/src/common/buffers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-15 16:40:11 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-15 16:40:11 -0400
commit76c33f7ff46df47df0cc880595c4d943d50f019b (patch)
tree11448ec9afd6990160ce6212c020d3c2630448d6 /src/common/buffers.c
parentc1deabd3b0c9e2701696afc80ac8392f0efda2c7 (diff)
parenta28e239b171c1a69fd32b6583bca0559f7116445 (diff)
downloadtor-76c33f7ff46df47df0cc880595c4d943d50f019b.tar.gz
tor-76c33f7ff46df47df0cc880595c4d943d50f019b.zip
Merge branch 'scan-build-032'
Diffstat (limited to 'src/common/buffers.c')
-rw-r--r--src/common/buffers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/buffers.c b/src/common/buffers.c
index d8f33aeed6..55a30092ee 100644
--- a/src/common/buffers.c
+++ b/src/common/buffers.c
@@ -907,6 +907,8 @@ buf_peek_startswith(const buf_t *buf, const char *cmd)
{
char tmp[PEEK_BUF_STARTSWITH_MAX];
size_t clen = strlen(cmd);
+ if (clen == 0)
+ return 1;
if (BUG(clen > sizeof(tmp)))
return 0;
if (buf->datalen < clen)