[PATCH grubby] Add check for return value of getuuidbydev (#592294)

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

 



If the device doesn't exist this can return a null. Check before calling
strcmp() and return 0 if it fails.

Resolves: rhbz#592294
---
 grubby.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/grubby.c b/grubby.c
index ccc0279..c984c04 100644
--- a/grubby.c
+++ b/grubby.c
@@ -1293,6 +1293,10 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix,
     if (!rootdev)
 	return 0;
 
+    if (!getuuidbydev(rootdev) || !getuuidbydev(dev)) {
+        free(rootdev);
+        return 0;
+    }
 
     if (strcmp(getuuidbydev(rootdev), getuuidbydev(dev))) {
 	free(rootdev);
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux