Bug 835029 - Fix off-by-one error in readlink call. r=briansmith

This commit is contained in:
Maxime Villard 2013-11-15 21:46:37 -05:00
parent c30a39b01e
commit 676fc480e0

View File

@ -511,7 +511,7 @@ bool ModuleInfoCallback(const ModuleInfo &module_info, void *context) {
int count;
snprintf(path, sizeof (path), "/proc/self/path/%s", module_info.name);
if ((count = readlink(path, buf, PATH_MAX)) < 0)
if ((count = readlink(path, buf, PATH_MAX - 1)) < 0)
return false;
buf[count] = '\0';