diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-02-10 14:00:07 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-02-10 14:00:07 +0000 |
commit | 2c711a2502ae1a254fe5837f8021f46c31e3c812 (patch) | |
tree | c8772d472e7f118559a4ca56f6f5d9c6cf04a057 /libdm/libdm-report.c | |
parent | 36ddbdbbe2082f8832218e70ae0d62f6e77c7a28 (diff) | |
download | lvm2-2c711a2502ae1a254fe5837f8021f46c31e3c812.tar.gz lvm2-2c711a2502ae1a254fe5837f8021f46c31e3c812.tar.xz lvm2-2c711a2502ae1a254fe5837f8021f46c31e3c812.zip |
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).
Diffstat (limited to 'libdm/libdm-report.c')
-rw-r--r-- | libdm/libdm-report.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 == ',') |