d22c72f730
and replace with strlcpy; found with malloc.conf ok millert@
30 lines
782 B
Plaintext
30 lines
782 B
Plaintext
$OpenBSD: patch-cidr_c,v 1.1 2004/06/16 18:07:53 david Exp $
|
|
--- cidr.c.orig 2000-06-20 18:10:55.000000000 -0500
|
|
+++ cidr.c 2004-06-16 12:46:55.000000000 -0500
|
|
@@ -154,14 +154,14 @@ int main(int argc, char *argv[])
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
- strncpy(ip[2],argv[1],18);
|
|
+ strlcpy(ip[2],argv[1],19);
|
|
|
|
|
|
holdaddress=strtok(ip[2],sep);
|
|
if(holdaddress==NULL)
|
|
invalid(1);
|
|
|
|
- strncpy(ip[0],holdaddress,strlen(holdaddress));
|
|
+ strlcpy(ip[0],holdaddress,strlen(holdaddress)+1);
|
|
if(ip[0]==NULL)
|
|
invalid(1);
|
|
|
|
@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
|
|
if(holdprefix==NULL)
|
|
invalid(1);
|
|
|
|
- strncpy(ip[1],holdprefix,strlen(holdprefix));
|
|
+ strlcpy(ip[1],holdprefix,strlen(holdprefix)+1);
|
|
if(ip[1]==NULL)
|
|
invalid(1);
|
|
|