diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-11 22:51:23 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-13 11:17:05 +0100 |
commit | d74e1291cd43f50010c22fb2c071d92390a26d28 (patch) | |
tree | 2afc2a846b74f4e44cf48539518ccf8a26128fec | |
parent | 0128770d6d881c7f30fc5e22137d1b20ce003e13 (diff) | |
download | lvm2-d74e1291cd43f50010c22fb2c071d92390a26d28.tar.gz |
libdm: put in secure check
Coverity complains about NULL deref - while this cannot currently
happen, put in secure INTERNAL_ERROR.
-rw-r--r-- | libdm/libdm-report.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index b9906d850..38dde0778 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -3527,6 +3527,10 @@ static struct field_selection *_create_field_selection(struct dm_report *rh, } break; case DM_REPORT_FIELD_TYPE_STRING_LIST: + if (!custom) { + log_error(INTERNAL_ERROR "Custom selection list is undefined."); + goto error; + } fs->value->v.l = *(struct selection_str_list **)custom; if (_check_value_is_strictly_reserved(rh, field_num, DM_REPORT_FIELD_TYPE_STRING_LIST, fs->value->v.l, NULL)) { log_error("String list value found in selection is reserved."); |