summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WHATS_NEW_DM1
-rw-r--r--libdm/libdm-report.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 2c4a70ff..44a656c3 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.70 -
===================================
+ Do not crash for dm_report_init() sort_key == NULL and behave like "".
Return error for failing allocation in dm_asprintf().
Add missing test for failing allocation in dm_realloc() code.
Add test for memory allocation failures in regex matcher code.
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 3d34b7e3..3f867674 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -541,6 +541,9 @@ static int _parse_keys(struct dm_report *rh, const char *keys,
const char *ws; /* Word start */
const char *we = keys; /* Word end */
+ if (!keys)
+ return 1;
+
while (*we) {
/* Allow consecutive commas */
while (*we && *we == ',')