From: Antonio Huete Jimenez Date: Fri, 5 Dec 2014 09:35:24 +0000 (+0100) Subject: installer - Fix a segfault X-Git-Tag: v4.2.0rc~1321 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/83c251b046d8f9b452dadd712f6818e77d542d74 installer - Fix a segfault - If survey was unable to detect any partition on the selected disk, as it is the case for unconfigured vn devices, do not attempt to dereference the selected_slice pointer. --- diff --git a/usr.sbin/installer/dfuibe_installer/fn_disk.c b/usr.sbin/installer/dfuibe_installer/fn_disk.c index 11cdf97bf2..1508b9c4ad 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_disk.c +++ b/usr.sbin/installer/dfuibe_installer/fn_disk.c @@ -596,6 +596,13 @@ format_slice(struct i_fn_args *a) * XXX should we do another one here anyway just to be paranoid? */ + /* + * Make sure the survey did get disk info correctly or fail + */ + if ((storage_get_selected_disk(a->s) == NULL) || + (storage_get_selected_slice(a->s) == NULL)) + return 0; + /* * Set the slice's sysid to 165. */