diff options
author | jh <jh@FreeBSD.org> | 2010-12-06 09:18:11 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2010-12-06 09:18:11 +0000 |
commit | 6664a6800aec6986163dafe4b247d1a781065579 (patch) | |
tree | e5df02602d495f7adaea3d902090c89eb17e238c /usr.bin/truss | |
parent | c0634c210540e4d95655c2c05ebae344ec03bb54 (diff) | |
download | FreeBSD-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/truss')
-rw-r--r-- | usr.bin/truss/syscalls.c | 2 |
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); } } |