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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216224

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