summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-03-07 13:02:47 +0000
committerOlivier Blin <oblin@mandriva.org>2005-03-07 13:02:47 +0000
commitf29b4388e4414e122491b6d330f332062b6fc53a (patch)
treeafc77341bc621654e0831ac819c60fa8d7eda304 /mdk-stage1
parentb78c5d7b88164b88fc0f44244074314cdf8600d8 (diff)
downloaddrakx-f29b4388e4414e122491b6d330f332062b6fc53a.tar
drakx-f29b4388e4414e122491b6d330f332062b6fc53a.tar.gz
drakx-f29b4388e4414e122491b6d330f332062b6fc53a.tar.bz2
drakx-f29b4388e4414e122491b6d330f332062b6fc53a.tar.xz
drakx-f29b4388e4414e122491b6d330f332062b6fc53a.zip
don't segault if proxy step is cancelled
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/network.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 10a42a74f..394986c84 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -748,8 +748,8 @@ static int choose_mirror_from_list(char *http_proxy_host, char *http_proxy_port,
char *selected_medium;
int fd, size, line_pos = 0;
char line[500];
- int use_http_proxy = !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
-
+ int use_http_proxy = http_proxy_host && http_proxy_port && !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
+
fd = http_download_file(MIRRORLIST_HOST, MIRRORLIST_PATH, &size, use_http_proxy ? "http" : NULL, http_proxy_host, http_proxy_port);
if (fd < 0) {
log_message("HTTP: unable to get mirrors list");
@@ -944,7 +944,7 @@ enum return_type ftp_prepare(void)
return ftp_prepare();
}
- use_http_proxy = !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
+ use_http_proxy = http_proxy_host && http_proxy_port && !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
strcpy(location_full, answers[1][0] == '/' ? "" : "/");
strcat(location_full, answers[1]);
@@ -1091,7 +1091,7 @@ enum return_type http_prepare(void)
log_message("HTTP: trying to retrieve %s from %s", location_full, answers[0]);
- use_http_proxy = !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
+ use_http_proxy = http_proxy_host && http_proxy_port && !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
fd = http_download_file(answers[0], location_full, &size, use_http_proxy ? "http" : NULL, http_proxy_host, http_proxy_port);
if (fd < 0) {