diff options
| author | joerg <joerg@NetBSD.org> | 2011-10-07 10:06:39 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2011-10-07 10:06:39 +0000 |
| commit | e63fd7b6bcbb030a502f954019ddeb6a616f961e (patch) | |
| tree | 5dbc4235804dea2c1377ebe270a7ea7a96cce760 /usr.sbin/bootp | |
| parent | f8c0b32d526ba1c34382a48ab5577eb7478f2874 (diff) | |
Fix under-allocation-by-one
Diffstat (limited to 'usr.sbin/bootp')
| -rw-r--r-- | usr.sbin/bootp/common/readfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bootp/common/readfile.c b/usr.sbin/bootp/common/readfile.c index f3611a79af6..6c4576cc84a 100644 --- a/usr.sbin/bootp/common/readfile.c +++ b/usr.sbin/bootp/common/readfile.c @@ -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; } |
