From: Wu Guanghao Date: Mon, 16 Aug 2021 07:24:51 +0000 (+0800) Subject: mdadm: fix coredump of mdadm --monitor -r X-Git-Tag: mdadm-4.2-rc3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=546047688e1c;p=thirdparty%2Fmdadm.git mdadm: fix coredump of mdadm --monitor -r The --monitor -r option requires a parameter, otherwise a null pointer will be manipulated when converting to integer data, and a coredump will appear. Segmentation fault (core dumped) Signed-off-by: Wu Guanghao Acked-by: Mariusz Tkaczyk Signed-off-by: Jes Sorensen --- diff --git a/ReadMe.c b/ReadMe.c index 978796ac..37d84625 100644 --- a/ReadMe.c +++ b/ReadMe.c @@ -81,11 +81,11 @@ char Version[] = "mdadm - v" VERSION " - " VERS_DATE EXTRAVERSION "\n"; * found, it is started. */ -char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:"; +char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:r:n:x:u:c:d:z:U:N:safRSow1tye:k"; char short_bitmap_options[]= - "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:"; + "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:r:n:x:u:c:d:z:U:N:sarfRSow1tye:k:"; char short_bitmap_auto_options[]= - "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:"; + "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:r:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:"; struct option long_options[] = { {"manage", 0, 0, ManageOpt},