summaryrefslogtreecommitdiffstats
path: root/isys/eddsupport.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-08-04 18:03:09 +0000
committerJeremy Katz <katzj@redhat.com>2004-08-04 18:03:09 +0000
commit7ea3aa6a0c066a5f3c3d99ee5e5d9dcd26c2c23d (patch)
tree5cc4b693baaeba495d5a31d1be9d7abb8cb54ac8 /isys/eddsupport.c
parentbe4dc011f30a2ac4ed0bbcd71d17fd60a6ed8c55 (diff)
downloadanaconda-7ea3aa6a0c066a5f3c3d99ee5e5d9dcd26c2c23d.tar.gz
anaconda-7ea3aa6a0c066a5f3c3d99ee5e5d9dcd26c2c23d.tar.xz
anaconda-7ea3aa6a0c066a5f3c3d99ee5e5d9dcd26c2c23d.zip
don't segfault if we look for a non-existent disk
Diffstat (limited to 'isys/eddsupport.c')
-rw-r--r--isys/eddsupport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/isys/eddsupport.c b/isys/eddsupport.c
index 72280c945..63cd29ce0 100644
--- a/isys/eddsupport.c
+++ b/isys/eddsupport.c
@@ -297,6 +297,7 @@ static int addToHashTable(struct diskMapTable *hashTable,
char * getBiosDisk(char *biosStr) {
uint32_t biosNum;
+ struct diskMapEntry * disk;
if (diskHashInit == 0) {
probeBiosDisks();
@@ -307,5 +308,8 @@ char * getBiosDisk(char *biosStr) {
return NULL;
sscanf(biosStr,"%x",&biosNum);
- return lookupHashItem(mbrSigToName, biosNum)->diskname;
+ disk = lookupHashItem(mbrSigToName, biosNum);
+ if (disk) return disk->diskname;
+
+ return NULL;
}