[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

yaboot-installer bugs



Howdy,

I've found two bugs in yaboot-installer:

 * space is not allocated for valid_device_list NUL-terminator,
   and

 * if devices are found, but none of them have a bootable
   partition, the message to this effect is not displayed.

Please apply the appended patch.

Does debconf optimize away one-option selects?  If not, the user
will be prompted to select from a list with only one element.

Matt

--- choose-yaboot-disk.c.orig	2002-09-18 18:49:26.000000000 -0700
+++ choose-yaboot-disk.c	2002-09-18 19:05:42.000000000 -0700
@@ -100,7 +100,7 @@
 	      char *partname;
 	      asprintf(&partname, "%s%d", devname, partition->num);
 	      printf("%s is bootable\n", partname);
-	      valid_device_list = realloc(valid_device_list, strlen(valid_device_list) + 1 + strlen(partname));
+	      valid_device_list = realloc(valid_device_list, strlen(valid_device_list) + 1 + strlen(partname) + 1);
 	      strcat(valid_device_list, " ");
 	      strcat(valid_device_list, partname);
 	    }
@@ -111,7 +111,7 @@
   }
 
   client = debconfclient_new ();
-  if (strlen(device_list) == 0) {
+  if (strlen(valid_device_list) == 0) {
     client->command (client, "title", "No valid boot device", NULL);
     client->command (client, "fset", "yaboot-installer/no-valid-bootdev", "seen", "false", NULL);
     client->command (client, "input", "high", "yaboot-input/no-valid-bootdev", NULL);



Reply to: