From 1d2af8d38842427feba909b2f47275120d104ec8 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 14 Jun 2020 16:13:51 +0100 Subject: [PATCH 1/2] Problem: formatting error in ip.cpp Solution: fix it --- src/ip.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ip.cpp b/src/ip.cpp index 7550bdec..ed49f52c 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -102,9 +102,8 @@ zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_) #if defined ZMQ_HAVE_WINDOWS && defined WSA_FLAG_NO_HANDLE_INHERIT // if supported, create socket with WSA_FLAG_NO_HANDLE_INHERIT, such that // the race condition in making it non-inheritable later is avoided - const fd_t s = - WSASocket (domain_, type_, protocol_, NULL, 0, - WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT); + const fd_t s = WSASocket (domain_, type_, protocol_, NULL, 0, + WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT); #else const fd_t s = socket (domain_, type_, protocol_); #endif From 3856027da94378ff793d5791f0325d1a8717bc11 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 14 Jun 2020 15:20:08 +0100 Subject: [PATCH 2/2] Problem: test_bind_fuzzer does not build on OSX Solution: use POSIX API instead of GNU extension --- tests/test_bind_fuzzer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_bind_fuzzer.cpp b/tests/test_bind_fuzzer.cpp index 547880bb..0af35d8b 100644 --- a/tests/test_bind_fuzzer.cpp +++ b/tests/test_bind_fuzzer.cpp @@ -36,13 +36,18 @@ #include "testutil.hpp" #include "testutil_unity.hpp" +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + // Test that zmq_bind can handle malformed strings extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) { // This test might create socket files, so move to /tmp to avoid clobbering // the working directory with random filenames - char *pwd = get_current_dir_name (); + char *pwd = (char *) malloc (PATH_MAX + 1); TEST_ASSERT_NOT_NULL (pwd); + TEST_ASSERT_NOT_NULL (getcwd (pwd, PATH_MAX + 1)); TEST_ASSERT_SUCCESS_ERRNO (chdir ("/tmp")); setup_test_context ();