From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Wilck Subject: Re: [PATCH v2] libmultipath: check udev_device_get_* return value to avoid segfault Date: Mon, 21 Sep 2020 11:14:24 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: lixiaokeng , Benjamin Marzinski , Christophe Varoqui , dm-devel mailing list Cc: linfeilong , "liuzhiqiang (I)" List-Id: dm-devel.ids 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