Skip to content
Snippets Groups Projects
Commit 103d59eb authored by Morris Jette's avatar Morris Jette
Browse files

Fix for possible out-of-bounds memory reference

Bug introduced yesterday in commit 239cfa96
parent 239cfa96
No related branches found
No related tags found
No related merge requests found
...@@ -325,7 +325,7 @@ int slurm_get_cpuset(char *path, pid_t pid, size_t size, cpu_set_t *mask) ...@@ -325,7 +325,7 @@ int slurm_get_cpuset(char *path, pid_t pid, size_t size, cpu_set_t *mask)
error("open(%s): %m", file_path); error("open(%s): %m", file_path);
return SLURM_ERROR; return SLURM_ERROR;
} }
rc = read(fd, mstr, sizeof(mstr)); rc = read(fd, mstr, sizeof(mstr) - 1);
close(fd); close(fd);
if (rc < 1) { if (rc < 1) {
error("read(%s): %m", file_path); error("read(%s): %m", file_path);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment