diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-25 18:48:01 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-25 18:48:01 +0000 |
commit | 20664351981fae2b02fc2febbc44247c78e3f388 (patch) | |
tree | 71ad81116b609bacb15c4255ceb35e2f5757b224 /sys/arch | |
parent | d5da15f4e5826dbaae538ad146958c49ca6e648b (diff) |
allocate 1 byte extra in getprop(), for the NUL that some callers like
to place. This is a nightmare, and we must move away from these stupid
wrapper APIs. ok kettenis
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/sparc64/autoconf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 3e55335ed91..6c33cb24ff8 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.72 2007/10/25 05:19:55 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.73 2007/10/25 18:48:00 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -871,7 +871,7 @@ getprop(node, name, size, nitem, bufp) buf = *bufp; if (buf == NULL) { /* No storage provided, so we allocate some */ - buf = malloc(len, M_DEVBUF, M_NOWAIT); + buf = malloc(len + 1, M_DEVBUF, M_NOWAIT); if (buf == NULL) return (ENOMEM); } |