Don't write the terminating NUL past end of buffer.

PR:		bin/152345
Submitted by:	Mateusz Guzik
This commit is contained in:
Jaakko Heinonen 2010-12-06 09:18:11 +00:00
parent 443a48f0a1
commit cdfc719c2e

View File

@ -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);
}
}