summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--loader2/urlinstall.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index f7d07ee41..719b425e6 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -185,7 +185,7 @@ char * mountUrlImage(struct installMethod * method,
moduleInfoSet modInfo, moduleList modLoaded,
moduleDeps * modDeps, int flags) {
int rc;
- char * url;
+ char * url, *p;
struct iurlinfo ui;
char needsSecondary = ' ';
int dir = 1;
@@ -302,6 +302,12 @@ char * mountUrlImage(struct installMethod * method,
url = malloc(strlen(finalPrefix) + 25 + strlen(ui.address) +
strlen(login));
+ /* sanitize url so we dont have problems like bug #101265 */
+ /* basically avoid duplicate /'s */
+ for (p=finalPrefix; *p == '/'; p++);
+
+ finalPrefix = p;
+
sprintf(url, "%s://%s%s/%s",
ui.protocol == URL_METHOD_FTP ? "ftp" : "http",
login, ui.address, finalPrefix);