From dab1e823bd8e953b544fce54cc3838489b5ba851 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 11:34:16 -0400 Subject: [PATCH 1/7] fixing get_gateway malloc error issue #21 --- src/get_gateway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_gateway.c b/src/get_gateway.c index 26f6404..25eca38 100644 --- a/src/get_gateway.c +++ b/src/get_gateway.c @@ -72,7 +72,7 @@ int send_nl_req(uint16_t msg_type, uint32_t seq, return -1; } - memset(nlmsg, 0, sizeof(nlmsg)); + memset(nlmsg, 0, sizeof(struct nlmsghdr)); memcpy(NLMSG_DATA(nlmsg), payload, payload_len); nlmsg->nlmsg_type = msg_type; nlmsg->nlmsg_len = NLMSG_LENGTH(payload_len); From aa090e63ebb0214bdbfc4a48fba6b45a7e3305f7 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 21:02:27 -0400 Subject: [PATCH 2/7] Fixing issue #24; accidentally clobbering LDFLAGS and CFLAGS previously. --- src/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index 72eb0d5..5848a66 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,6 @@ -CC=gcc - -CFLAGS=-Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -LDFLAGS=-g -pthread -LDLIBS= -lpcap -lgmp -lm +CFLAGS+=-Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g +LDFLAGS+=-g -pthread +LDLIBS+= -lpcap -lgmp -lm TARGETS=zmap VPATH=../lib:output_modules:probe_modules PREFIX=/usr/local From 12750cec8d4bdbd24960d6246f47591efdca9b2e Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 22:46:05 -0400 Subject: [PATCH 3/7] fixing issue #28, fixing memset operation in send_nl_req. --- src/get_gateway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_gateway.c b/src/get_gateway.c index 25eca38..e015fa8 100644 --- a/src/get_gateway.c +++ b/src/get_gateway.c @@ -72,7 +72,7 @@ int send_nl_req(uint16_t msg_type, uint32_t seq, return -1; } - memset(nlmsg, 0, sizeof(struct nlmsghdr)); + memset(nlmsg, 0, NLMSG_SPACE(payload_len)); memcpy(NLMSG_DATA(nlmsg), payload, payload_len); nlmsg->nlmsg_type = msg_type; nlmsg->nlmsg_len = NLMSG_LENGTH(payload_len); From 2a2ce7a2d0def1873c795217ebed0d064aa9ef42 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 11:34:16 -0400 Subject: [PATCH 4/7] fixing get_gateway malloc error issue #21 --- src/get_gateway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_gateway.c b/src/get_gateway.c index 26f6404..25eca38 100644 --- a/src/get_gateway.c +++ b/src/get_gateway.c @@ -72,7 +72,7 @@ int send_nl_req(uint16_t msg_type, uint32_t seq, return -1; } - memset(nlmsg, 0, sizeof(nlmsg)); + memset(nlmsg, 0, sizeof(struct nlmsghdr)); memcpy(NLMSG_DATA(nlmsg), payload, payload_len); nlmsg->nlmsg_type = msg_type; nlmsg->nlmsg_len = NLMSG_LENGTH(payload_len); From 581725a8dd992a53597b8bbe3d4b67fcd059b067 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 21:02:27 -0400 Subject: [PATCH 5/7] Fixing issue #24; accidentally clobbering LDFLAGS and CFLAGS previously. --- src/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index 72eb0d5..5848a66 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,6 @@ -CC=gcc - -CFLAGS=-Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -LDFLAGS=-g -pthread -LDLIBS= -lpcap -lgmp -lm +CFLAGS+=-Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g +LDFLAGS+=-g -pthread +LDLIBS+= -lpcap -lgmp -lm TARGETS=zmap VPATH=../lib:output_modules:probe_modules PREFIX=/usr/local From 28e698cc7f492263b492c7033807bc3a35435484 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 22:46:05 -0400 Subject: [PATCH 6/7] fixing issue #28, fixing memset operation in send_nl_req. --- src/get_gateway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_gateway.c b/src/get_gateway.c index 25eca38..e015fa8 100644 --- a/src/get_gateway.c +++ b/src/get_gateway.c @@ -72,7 +72,7 @@ int send_nl_req(uint16_t msg_type, uint32_t seq, return -1; } - memset(nlmsg, 0, sizeof(struct nlmsghdr)); + memset(nlmsg, 0, NLMSG_SPACE(payload_len)); memcpy(NLMSG_DATA(nlmsg), payload, payload_len); nlmsg->nlmsg_type = msg_type; nlmsg->nlmsg_len = NLMSG_LENGTH(payload_len); From d7972dec682308f55fae4b0871ba4f8b5e2c63d7 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 23:00:16 -0400 Subject: [PATCH 7/7] updating changelog --- CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index ccb9f70..c827543 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,3 +12,8 @@ SUPPORT Issue #1 "Failure at calloc for 'ip_seen' on KVM VPSs?" 1.0.2 2013-8-18 BUGFIX Issue #14 "gcc 4.7.2 -Wunprototyped-calls error with recv_run." - changed recv_run header to match def in recv.c + +1.0.3 2013-8-19 +BUGFIX Issues 21,28 "fixed get_gateway malloc/memset errors" +BUGFIX Issue 24 "Makefile does not respect LDFLAGS" + - changed = to += for CFLAGS, LDFAGS, and LDLIBS