summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2010-12-06 09:18:11 +0000
committerjh <jh@FreeBSD.org>2010-12-06 09:18:11 +0000
commit6664a6800aec6986163dafe4b247d1a781065579 (patch)
treee5df02602d495f7adaea3d902090c89eb17e238c /usr.bin
parentc0634c210540e4d95655c2c05ebae344ec03bb54 (diff)
downloadFreeBSD-src-6664a6800aec6986163dafe4b247d1a781065579.zip
FreeBSD-src-6664a6800aec6986163dafe4b247d1a781065579.tar.gz
Don't write the terminating NUL past end of buffer.
PR: bin/152345 Submitted by: Mateusz Guzik
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/truss/syscalls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index 7ef8e19..f19553d2 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -518,7 +518,7 @@ get_string(pid_t pid, void *offset, int max)
buf = realloc(buf, totalsize);
size = BLOCKSIZE;
} else {
- buf[totalsize] = '\0';
+ buf[totalsize - 1] = '\0';
return (buf);
}
}
OpenPOWER on IntegriCloud