summaryrefslogtreecommitdiff
path: root/src/common/buffers.c
diff options
context:
space:
mode:
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 50673646df..9583c70361 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)