Browse Source

Use validated index in json_type_to_name.

Another currently unreachable issue. The enum o_type was casted to an
int and this int has been validated to be an index.

Therefore use the int, not the enum as index. Defensive measure for
a probably never occurring future in which the enum would contain
values larger than INT_MAX.
pull/661/head
Tobias Stoeckmann 5 years ago
parent
commit
710c411880
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      json_util.c

+ 1
- 1
json_util.c View File

@@ -292,5 +292,5 @@ const char *json_type_to_name(enum json_type o_type)
NELEM(json_type_name));
return NULL;
}
return json_type_name[o_type];
return json_type_name[o_type_int];
}

Loading…
Cancel
Save