mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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 (cherry picked from commit 6f152befb4523fd2e57c1a937e590f8ff87b7f15)
This commit is contained in:
parent
6b8d02a755
commit
a91abd0e8e
@ -232,6 +232,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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user