mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix segfault when invalid field given in reporting commands.
Problem is dm_report_init() may return NULL and subsequent call to dm_report_set_output_field_name_prefix() doesn't handle NULL value. Example: pvs --nameprefixes --rows --unquoted --noheadings -opv_name,fred Logical Volume Fields --------------------- lv_uuid - Unique identifier lv_name - Name. LVs created for internal use are enclosed in brackets. ... Physical Volume Segment Fields ------------------------------ pvseg_start - Physical Extent number of start of segment. pvseg_size - Number of extents in segment. Unrecognised field: fred Segmentation fault
This commit is contained in:
parent
7b6c011c54
commit
539f903fd2
@ -1,5 +1,6 @@
|
||||
Version 2.02.44 -
|
||||
====================================
|
||||
Fix segfault when invalid field given in reporting commands.
|
||||
Refactor init_lvm() for lvmcmdline and clvmd.
|
||||
Add liblvm interactive test infrastructure to build.
|
||||
Use better random seed value in temp file creation.
|
||||
|
@ -1108,7 +1108,7 @@ void *report_init(struct cmd_context *cmd, const char *format, const char *keys,
|
||||
rh = dm_report_init(report_type, _report_types, _fields, format,
|
||||
separator, report_flags, keys, cmd);
|
||||
|
||||
if (field_prefixes)
|
||||
if (rh && field_prefixes)
|
||||
dm_report_set_output_field_name_prefix(rh, "lvm2_");
|
||||
|
||||
return rh;
|
||||
|
Loading…
Reference in New Issue
Block a user