From 9d2c667b951fa67f70bebc863f005dd1d10de91c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 3 Sep 2009 12:18:43 +0200 Subject: conntrackd: net message memory allocation is unsafe We cannot assume that we will not write in the net message before we send it, because the memory allocated for the net message (__net) is only reserved in BUILD_NETMSG (because of the { } block in it). This patch marks the buffer as static to avoid this problem. Based on a patch from Samuel Gauthier Signed-off-by: Pablo Neira Ayuso --- include/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/network.h b/include/network.h index 3248245..dfc3015 100644 --- a/include/network.h +++ b/include/network.h @@ -81,7 +81,7 @@ enum { #define BUILD_NETMSG(ct, query) \ ({ \ - char __net[4096]; \ + static char __net[4096]; \ struct nethdr *__hdr = (struct nethdr *) __net; \ memset(__hdr, 0, NETHDR_SIZ); \ nethdr_set(__hdr, query); \ -- cgit v1.2.3