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

config: check vdef pointer before dereference

Coverity notices we check for v_def != NULL elsewhere, so it thinks
it may be possibly NULL also here.
This commit is contained in:
Zdenek Kabelac 2015-11-16 00:42:29 +01:00
parent 96d73dc6ea
commit 193e7f5973

View File

@ -891,7 +891,7 @@ static int _check_value_differs_from_default(struct cft_check_handle *handle,
} }
break; break;
case DM_CFG_EMPTY_ARRAY: case DM_CFG_EMPTY_ARRAY:
diff = v_def->type != DM_CFG_EMPTY_ARRAY; diff = (v_def && (v_def->type != DM_CFG_EMPTY_ARRAY));
break; break;
default: default:
log_error(INTERNAL_ERROR "inconsistent state reached in _check_value_differs_from_default"); log_error(INTERNAL_ERROR "inconsistent state reached in _check_value_differs_from_default");