Module Name:    src
Committed By:   joerg
Date:           Fri Oct  7 10:06:39 UTC 2011

Modified Files:
        src/usr.sbin/bootp/common: readfile.c

Log Message:
Fix under-allocation-by-one


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/bootp/common/readfile.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/bootp/common/readfile.c
diff -u src/usr.sbin/bootp/common/readfile.c:1.18 src/usr.sbin/bootp/common/readfile.c:1.19
--- src/usr.sbin/bootp/common/readfile.c:1.18	Tue Jan  4 09:16:17 2011
+++ src/usr.sbin/bootp/common/readfile.c	Fri Oct  7 10:06:39 2011
@@ -22,7 +22,7 @@ SOFTWARE.
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: readfile.c,v 1.18 2011/01/04 09:16:17 wiz Exp $");
+__RCSID("$NetBSD: readfile.c,v 1.19 2011/10/07 10:06:39 joerg Exp $");
 #endif
 
 
@@ -1208,9 +1208,9 @@ get_shared_string(char **src)
 	(void) get_string(src, retstring, &length);
 
 	s = (struct shared_string *) smalloc(sizeof(struct shared_string) +
-	    length);
+	    length + 1);
 	s->linkcount = 1;
-	strlcpy(s->string, retstring, sizeof(retstring));
+	memcpy(s->string, retstring, length + 1);
 
 	return s;
 }

Reply via email to