summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2020-06-25 09:59:35 +0300
committerAzat Khuzhin <azat@libevent.org>2020-06-25 09:59:35 +0300
commit6f152befb4523fd2e57c1a937e590f8ff87b7f15 (patch)
tree89d54f7a9103605d002a860b75808136d556ae1d /test
parent37dbb3508099d49748453166c1ee9ef1603fcf3a (diff)
downloadlibevent-6f152befb4523fd2e57c1a937e590f8ff87b7f15.tar.gz
test: do not pass NULL to memcmp() in evbuffer_datacmp() helper
Fixes: runtime error: null pointer passed as argument 2, which is declared to never be null
Diffstat (limited to 'test')
-rw-r--r--test/regress_http.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/regress_http.c b/test/regress_http.c
index 279dcd4d..4353ca5f 100644
--- a/test/regress_http.c
+++ b/test/regress_http.c
@@ -267,6 +267,8 @@ evbuffer_datacmp(struct evbuffer *buf, const char *s)
return -1;
d = evbuffer_pullup(buf, s_sz);
+ if (!d)
+ d = (unsigned char *)"";
if ((r = memcmp(d, s, s_sz)))
return r;