From d07ded6e52ad8154e72966f3e77e32db1426f938 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 17 Apr 2010 23:31:38 +0200 Subject: [PATCH] Use strlcpy instead of strncpy. --- src/util-radix-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util-radix-tree.c b/src/util-radix-tree.c index a5e4d279ca..dad81dcfcb 100644 --- a/src/util-radix-tree.c +++ b/src/util-radix-tree.c @@ -974,7 +974,7 @@ SCRadixNode *SCRadixAddKeyIPV4String(const char *str, SCRadixTree *tree, void *u struct in_addr addr; /* Make a copy of the string so it can be modified */ - strncpy(ip_str, str, sizeof(ip_str) - 2); + strlcpy(ip_str, str, sizeof(ip_str) - 2); *(ip_str + (sizeof(ip_str) - 1)) = '\0'; /* Does it have a mask? */ @@ -1022,7 +1022,7 @@ SCRadixNode *SCRadixAddKeyIPV6String(const char *str, SCRadixTree *tree, void *u struct in6_addr addr; /* Make a copy of the string so it can be modified */ - strncpy(ip_str, str, sizeof(ip_str) - 2); + strlcpy(ip_str, str, sizeof(ip_str) - 2); *(ip_str + sizeof(ip_str) - 1) = '\0'; /* Does it have a mask? */