Don't write the terminating NUL past end of buffer.
PR: bin/152345 Submitted by: Mateusz Guzik
This commit is contained in:
parent
443a48f0a1
commit
cdfc719c2e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216224
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user