Skip to content

Commit

Permalink
test: fix UB in evbuffer/empty_reference_prepend_buffer
Browse files Browse the repository at this point in the history
UBSAN reports:
  test/regress_buffer.c:2360:2: runtime error: null pointer passed as argument 1, which is declared to never be null
  /usr/include/string.h:140:33: note: nonnull attribute specified here
  • Loading branch information
azat committed Jul 5, 2020
1 parent 9da1743 commit ba19b35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/regress_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,7 @@ test_evbuffer_empty_reference_prepend_buffer(void *ptr)
tt_assert(!strncmp((char *)evbuffer_pullup(buf2, -1), "foo", 3));
evbuffer_validate(buf2);

tt_assert(!strncmp((char *)evbuffer_pullup(buf1, -1), "", 0));
tt_assert(evbuffer_pullup(buf1, -1) == NULL);
evbuffer_validate(buf2);

end:
Expand Down

0 comments on commit ba19b35

Please sign in to comment.