Fixes coredump when stats parse request
@@ -505,7 +505,6 @@ stats_add_num(struct stats_buffer *buf, struct string *key, int64_t val)
}
return DN_OK;
-
}
static rstatus_t
@@ -996,6 +995,9 @@ parse_request(int sd, struct stats_cmd *st_cmd)
} else { // message received
log_debug(LOG_VERB, "%s", mesg);
reqline[0] = strtok(mesg, " \t\n");
+ if (!reqline[0]) {
+ return;
+ }
if ( strncmp(reqline[0], "GET\0", 4) == 0 ) {
reqline[1] = strtok (NULL, " \t");
reqline[2] = strtok (NULL, " \t\n");
@@ -1139,7 +1141,6 @@ parse_request(int sd, struct stats_cmd *st_cmd)
}
}
}
-
}
