]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm/Monitor: Fix NULL pointer dereference when stat2devnm return NULL
authorZhilong Liu <zlliu@suse.com>
Mon, 20 Mar 2017 05:21:41 +0000 (13:21 +0800)
committerJes Sorensen <Jes.Sorensen@gmail.com>
Mon, 27 Mar 2017 22:24:19 +0000 (18:24 -0400)
commit75dd32a185871fead13cd3586e00980b35410ff0
treedd473e9cb5a2574fd71abd52a913576bc9017a0b
parente81070a69bf0c6e20f95806b6c60f6ec5c952a20
mdadm/Monitor: Fix NULL pointer dereference when stat2devnm return NULL

Wait(): stat2devnm() returns NULL for non block devices. Check the
pointer is valid derefencing it. This can happen when using --wait,
such as the 'f' and 'd' file type, causing a core dump.
such as: ./mdadm --wait /dev/md/

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Monitor.c