mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 18:40:27 +01:00
Problem: test_socket_options_fuzzer can pass non-NUL terminated data buffers
Solution: ensure they are valid strings
This commit is contained in:
parent
36dc251ed0
commit
6386bc13d3
@ -43,6 +43,9 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
||||
void *s = test_context_socket (ZMQ_XPUB);
|
||||
int option;
|
||||
|
||||
// A lot of options expect a well-formatted string
|
||||
((uint8_t *)data)[size - 1] = 0;
|
||||
|
||||
for (option = ZMQ_AFFINITY; option < ZMQ_BINDTODEVICE + 1; ++option) {
|
||||
uint8_t out[512];
|
||||
size_t out_size = 512;
|
||||
|
Loading…
Reference in New Issue
Block a user