summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgandalf <gandalf>2004-01-31 13:22:18 +0000
committergandalf <gandalf>2004-01-31 13:22:18 +0000
commitcd9735fb78524e6dcb4111db4c2f0f4a7ddaad9b (patch)
treea153ccbe02a71f78e29247f2f13cb8e9c27b2c49
parentddc013c214260f9cb75e040e3a2e3428faaf92da (diff)
Fix possibly not zero-terminated string after copy (Karsten Desler)
-rw-r--r--iptables.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/iptables.c b/iptables.c
index 21c9e49..dc70260 100644
--- a/iptables.c
+++ b/iptables.c
@@ -268,6 +268,7 @@ dotted_to_addr(const char *dotted)
/* copy dotted string, because we need to modify it */
strncpy(buf, dotted, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
addrp = (unsigned char *) &(addr.s_addr);
p = buf;