]> git.ipfire.org Git - thirdparty/mdadm.git/commit - config.c
Fix for segfault when reading /proc/mdstat
authorNeil Brown <neilb@suse.de>
Mon, 28 Apr 2008 06:29:12 +0000 (16:29 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 28 Apr 2008 06:29:12 +0000 (16:29 +1000)
commit2cdb64897d4fe33a11af13c6356dcd338c561e77
tree9eadf9a59d00d3bed84c96701c878c6722ad4f66
parent142cb9e181b876b399c548567dad5e011ff3d0dc
Fix for segfault when reading /proc/mdstat

Some kernel versions don't put a space between 'active' and '(auto-read-only)'
in /proc/mdstat.  This causes a parsing problem leaving 'level' set to
NULL which causes a crash.

So synthesise a space there if it is missing, and check for 'level' to
be NULL and don't de-ref if it is.
ChangeLog
Incremental.c
Monitor.c
config.c