1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Test seg pointer for non-null

As the function accepts NULL for 'seg' parameter,
check for it before dereference.
This commit is contained in:
Zdenek Kabelac 2012-02-27 10:15:08 +00:00
parent 0c35eb915c
commit e1153fd385
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.94 -
====================================
====================================
Test seg pointer for non-null it in raid_target_percent error path.
Check for errors in _init_tags() during config loading.
Always check result of _set_vg_name() in lvcreate.
Drop unused call to uname() during clvmd initialization.

View File

@ -230,7 +230,7 @@ static int _raid_target_percent(void **target_state,
if (!pos || (sscanf(pos, "%" PRIu64 "/%" PRIu64 "%n",
&numerator, &denominator, &i) != 2)) {
log_error("Failed to parse %s status fraction: %s",
seg->segtype->name, params);
(seg) ? seg->segtype->name : "segment", params);
return 0;
}