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

Fix for possible out of bounds memory reference reported by Coverity

parent 4537a17a
No related branches found
No related tags found
No related merge requests found
...@@ -968,7 +968,11 @@ static int _connect_srun_cr(char *addr) ...@@ -968,7 +968,11 @@ static int _connect_srun_cr(char *addr)
unsigned int sa_len; unsigned int sa_len;
int fd, rc; int fd, rc;
if (addr && (strlen(addr) > sizeof(sa.sun_path))) { if (!addr) {
error("%s: socket path name is NULL", __func__);
return -1;
}
if (strlen(addr) >= sizeof(sa.sun_path)) {
error("%s: socket path name too long (%s)", __func__, addr); error("%s: socket path name too long (%s)", __func__, addr);
return -1; return -1;
} }
......
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