[dm-devel] [PATCH v2] libmultipath: check udev_device_get_* return value to avoid segfault

Martin Wilck mwilck at suse.com
Mon Sep 21 09:14:24 UTC 2020


On Mon, 2020-09-21 at 12:00 +0800, lixiaokeng wrote:
> The udev_device_get_* function may return NULL, and it will be
> deregerenced in str* and sscanf func. We check the return value
> to avoid segfault. Fix all.
>

Thanks. Let me remark that this patch does _not_ fix all invocations of
udev_device_get_XYZ() (I suppose you meant something else with "Fix
all.", but please be more specific next time then).
See path_discover(), declare_sysfs_get_str(), for instance.

Anyway, that can be fixed later, so:

Reviewed-by: Martin Wilck <mwilck at suse.com>





More information about the dm-devel mailing list