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
@ -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