Skip to content

Commit

Permalink
Check for null val in __jdict_str
Browse files Browse the repository at this point in the history
Check for null before comparing dictionary value type
Missing "type" attribute in decomposition json file will cause ldmsd to crash
  • Loading branch information
nick-enoent committed Jun 28, 2023
1 parent 564784a commit 3978b74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ldms/src/ldmsd/ldmsd_decomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static json_str_t __jdict_str(json_entity_t dict, const char *key)
json_entity_t val;

val = __jdict_ent(dict, key);
if (val->type != JSON_STRING_VALUE) {
if (!val || val->type != JSON_STRING_VALUE) {
errno = EINVAL;
return NULL;
}
Expand Down

0 comments on commit 3978b74

Please sign in to comment.