aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/afl_network_proxy/GNUmakefile3
-rw-r--r--examples/afl_network_proxy/afl-network-server.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/examples/afl_network_proxy/GNUmakefile b/examples/afl_network_proxy/GNUmakefile
index eafc5249..cf1cbad5 100644
--- a/examples/afl_network_proxy/GNUmakefile
+++ b/examples/afl_network_proxy/GNUmakefile
@@ -11,7 +11,8 @@ ifdef STATIC
endif
ifeq "$(shell echo '$(HASH)include <libdeflate.h>@int main() { struct libdeflate_compressor *d = libdeflate_alloc_compressor(1); return 0;}' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test2 -ldeflate 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"
- CFLAGS += -ldeflate -DUSE_DEFLATE=1
+ CFLAGS += -DUSE_DEFLATE=1
+ LDFLAGS += -ldeflate
$(info libdeflate-dev was detected, using compression)
else
$(warn did not find libdeflate-dev, cannot use compression)
diff --git a/examples/afl_network_proxy/afl-network-server.c b/examples/afl_network_proxy/afl-network-server.c
index 01501cc9..2de91cbd 100644
--- a/examples/afl_network_proxy/afl-network-server.c
+++ b/examples/afl_network_proxy/afl-network-server.c
@@ -356,7 +356,7 @@ int recv_testcase(int s, void **buf, size_t *max_len) {
if ((size & 0xff000000) != 0xff000000) {
- *buf = maybe_grow(buf, max_len, size);
+ *buf = ck_maybe_grow(buf, max_len, size);
received = 0;
// fprintf(stderr, "unCOMPRESS (%u)\n", size);
while (received < size &&
@@ -368,7 +368,7 @@ int recv_testcase(int s, void **buf, size_t *max_len) {
#ifdef USE_DEFLATE
u32 clen;
size -= 0xff000000;
- *buf = maybe_grow(buf, max_len, size);
+ *buf = ck_maybe_grow(buf, max_len, size);
received = 0;
while (received < 4 &&
(ret = recv(s, &clen + received, 4 - received, 0)) > 0)
@@ -377,7 +377,7 @@ int recv_testcase(int s, void **buf, size_t *max_len) {
// fprintf(stderr, "received clen information of %d\n", clen);
if (clen < 1)
FATAL("did not receive valid compressed len information: %u", clen);
- buf2 = maybe_grow((void **)&buf2, &buf2_len, clen);
+ buf2 = ck_maybe_grow((void **)&buf2, &buf2_len, clen);
received = 0;
while (received < clen &&
(ret = recv(s, buf2 + received, clen - received, 0)) > 0)
@@ -566,7 +566,7 @@ int main(int argc, char **argv_orig, char **envp) {
sharedmem_t shm = {0};
fsrv->trace_bits = afl_shm_init(&shm, map_size, 0);
- in_data = maybe_grow((void **)&in_data, &max_len, 65536);
+ in_data = ck_maybe_grow((void **)&in_data, &max_len, 65536);
atexit(at_exit_handler);
setup_signal_handlers();
@@ -637,7 +637,7 @@ int main(int argc, char **argv_orig, char **envp) {
#ifdef USE_DEFLATE
compressor = libdeflate_alloc_compressor(1);
decompressor = libdeflate_alloc_decompressor();
- buf2 = maybe_grow((void **)&buf2, &buf2_len, map_size + 16);
+ buf2 = ck_maybe_grow((void **)&buf2, &buf2_len, map_size + 16);
lenptr = (u32 *)(buf2 + 4);
fprintf(stderr, "Compiled with compression support\n");
#endif