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

Prevent possible NULL memory reference

parent 088b3dfb
No related branches found
No related tags found
No related merge requests found
...@@ -1702,11 +1702,14 @@ _update_bluegene_subbp (int argc, char *argv[]) ...@@ -1702,11 +1702,14 @@ _update_bluegene_subbp (int argc, char *argv[])
*/ */
static int _update_slurmctld_debug(char *val) static int _update_slurmctld_debug(char *val)
{ {
char *endptr; char *endptr = NULL;
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
uint32_t level = (uint32_t)strtoul(val, &endptr, 10); uint32_t level;
if (*endptr != '\0' || level > 9) { if (val)
level = (uint32_t)strtoul(val, &endptr, 10);
if ((val == NULL) || (*endptr != '\0') || (level > 9)) {
error_code = 1; error_code = 1;
if (quiet_flag != 1) if (quiet_flag != 1)
fprintf(stderr, "invalid debug level: %s\n", fprintf(stderr, "invalid debug level: %s\n",
......
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