insist option != NULL and initalise last to NULL

This commit is contained in:
Mark Andrews
2018-05-01 16:03:46 +10:00
committed by Ondřej Surý
parent 7f2863196f
commit 8801c65a4b
3 changed files with 9 additions and 3 deletions

View File

@@ -1025,11 +1025,13 @@ static void
plus_option(char *option, struct query *query, isc_boolean_t global)
{
isc_result_t result;
char *cmd, *value, *last, *code;
char *cmd, *value, *last = NULL, *code;
isc_uint32_t num;
isc_boolean_t state = ISC_TRUE;
size_t n;
INSIST(option != NULL);
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
printf(";; Invalid option %s\n", option);
return;