Fix proxy FTP coredump.
authorjbj <devnull@localhost>
Thu, 25 Feb 1999 02:50:49 +0000 (02:50 +0000)
committerjbj <devnull@localhost>
Thu, 25 Feb 1999 02:50:49 +0000 (02:50 +0000)
CVS patchset: 2836
CVS date: 1999/02/25 02:50:49

url.c

diff --git a/url.c b/url.c
index 4e892d1..6d75fe2 100644 (file)
--- a/url.c
+++ b/url.c
@@ -129,8 +129,9 @@ static void findUrlinfo(urlinfo **uret, int mustAsk)
        }
 
        if (u->proxyh == NULL && (proxy = rpmGetVar(RPMVAR_FTPPROXY)) != NULL) {
-           char *nu = malloc(strlen(u->user) + strlen(u->host) + sizeof("@"));
-           strcpy(nu, u->user);
+           char *uu = (u->user ? u->user : "anonymous");
+           char *nu = malloc(strlen(u->user) + strlen(uu) + sizeof("@"));
+           strcpy(nu, uu);
            strcat(nu, "@");
            strcat(nu, u->host);
            u->proxyu = nu;