diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-10-05 08:00:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-10-05 08:00:47 +0000 |
commit | 9e314c5dd9fcf2e7b830796870e241379079ec31 (patch) | |
tree | b4879a5d31240d504ca73648fa9bf28fae0d8a70 /sys-fs/mdadm/files | |
parent | Avoid sandbox violations when xdg-mime is called during src_install, as repor... (diff) | |
download | gentoo-2-9e314c5dd9fcf2e7b830796870e241379079ec31.tar.gz gentoo-2-9e314c5dd9fcf2e7b830796870e241379079ec31.tar.bz2 gentoo-2-9e314c5dd9fcf2e7b830796870e241379079ec31.zip |
Add fix from upstream for segfault #287338 by Marcin Mirosław.
(Portage version: 2.2_rc42/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs/mdadm/files')
-rw-r--r-- | sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch b/sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch new file mode 100644 index 000000000000..c740421487b0 --- /dev/null +++ b/sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch @@ -0,0 +1,51 @@ +http://bugs.gentoo.org/287338 + +From 2b9aa337af7291d3f141322da96c9f667c99d53c Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Thu, 1 Oct 2009 12:51:04 +1000 +Subject: [PATCH] Fix null-dereference in set_member_info + +set_member_info would try to dereference ->metadata_version, without +checking that it isn't NULL. + +Signed-off-by: NeilBrown <neilb@suse.de> +--- + mapfile.c | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/mapfile.c b/mapfile.c +index a3038be..ed59db5 100644 +--- a/mapfile.c ++++ b/mapfile.c +@@ -303,19 +303,22 @@ struct map_ent *map_by_name(struct map_ent **map, char *name) + */ + static void set_member_info(struct supertype *st, struct mdstat_ent *ent) + { +- char version[strlen(ent->metadata_version)+1]; + + st->subarray[0] = '\0'; + +- if (strncmp(ent->metadata_version, "external:", 9) != 0) ++ if (ent->metadata_version == NULL || ++ strncmp(ent->metadata_version, "external:", 9) != 0) + return; + +- strcpy(version, ent->metadata_version); +- +- if (is_subarray(&version[9])) { +- char *subarray = strrchr(version, '/'); ++ if (is_subarray(&ent->metadata_version[9])) { ++ char version[strlen(ent->metadata_version)+1]; ++ char *subarray; + char *name = &version[10]; + ++ strcpy(version, ent->metadata_version); ++ subarray = strrchr(version, '/'); ++ name = &version[10]; ++ + if (!subarray) + return; + *subarray++ = '\0'; +-- +1.6.5.rc2 + |