mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-06 17:18:29 +03:00
Do not crash for NULL sort_key
Guard against NULL pointer for sort_key and let it behave like an empty string would have been passed in (i.e. no key).
This commit is contained in:
parent
36ddbdbbe2
commit
2c711a2502
@ -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.
|
||||
|
@ -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 == ',')
|
||||
|
Loading…
Reference in New Issue
Block a user