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

[PATCH] If the device disappeared during DD selection, do not crash (#521189)



---
 loader2/driverdisk.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 3a0a13c..0a53b93 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -288,6 +288,13 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
             char ** part_list = getPartitionsList(device);
             int nump = 0, num = 0;
 
+	    /* if somebody removed the drive, partition list is NULL */
+	    /* rhbz#521189 */
+	    if (!part_list){
+              stage = DEV_DEVICE;
+	      break;
+	    }
+
             if (part != NULL) free(part);
 
             if ((nump = lenPartitionsList(part_list)) == 0) {
-- 
1.6.4.4


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