diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | loader2/urls.c | 16 |
2 files changed, 13 insertions, 5 deletions
@@ -8,6 +8,8 @@ * partedUtils.py (DiskSet.openDevices): Ignore disks listed in ignoredisks, even if we have clearpart --all (#186438). + * loader2/urls.c (convertURLToUI): Check for NULL (#186210). + 2006-03-22 David Cantrell <dcantrell@redhat.com> * fsset.py (reiserfsFileSystem): Added missing labelDevice method. diff --git a/loader2/urls.c b/loader2/urls.c index a674298dc..d34fbefcb 100644 --- a/loader2/urls.c +++ b/loader2/urls.c @@ -75,11 +75,17 @@ int convertURLToUI(char *url, struct iurlinfo *ui) { /* url is left pointing at the hostname */ chptr = strchr(url, '/'); - *chptr = '\0'; - ui->address = strdup(url); - url = chptr; - *url = '/'; - ui->prefix = strdup(url); + if (chptr != NULL) { + *chptr = '\0'; + ui->address = strdup(url); + url = chptr; + *url = '/'; + ui->prefix = strdup(url); + } + else { + ui->address = strdup(url); + ui->prefix = strdup("/"); + } logMessage(DEBUGLVL, "url address %s", ui->address); logMessage(DEBUGLVL, "url prefix %s", ui->prefix); |