diff options
author | obrien <obrien@FreeBSD.org> | 2000-10-28 20:27:11 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-10-28 20:27:11 +0000 |
commit | a90e794625f844c7a6a29f8223943143bac3a03d (patch) | |
tree | baad2b6a272eaf8c85199b9be154817a6c832e55 /lib | |
parent | 0ecc67db2e066b45f29a6e637c34b53348aec5c6 (diff) | |
download | FreeBSD-src-a90e794625f844c7a6a29f8223943143bac3a03d.zip FreeBSD-src-a90e794625f844c7a6a29f8223943143bac3a03d.tar.gz |
Repeat after me, "check to see that a pointer isn't NULL before
dereferenceing it". This fixes ``pkg_add -r''.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libfetch/ftp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 00b1cf5..ec74ba2 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -887,7 +887,7 @@ fetchXGetFTP(struct url *url, struct url_stat *us, char *flags) int cd; /* get the proxy URL, and check if we should use HTTP instead */ - if (!strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL) { + if (flags && !strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL) { if (strcasecmp(purl->scheme, SCHEME_HTTP) == 0) return _http_request(url, "GET", us, purl, flags); } else { @@ -934,7 +934,7 @@ fetchPutFTP(struct url *url, char *flags) int cd; /* get the proxy URL, and check if we should use HTTP instead */ - if (!strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL) { + if (flags && !strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL) { if (strcasecmp(purl->scheme, SCHEME_HTTP) == 0) /* XXX HTTP PUT is not implemented, so try without the proxy */ purl = NULL; @@ -968,7 +968,7 @@ fetchStatFTP(struct url *url, struct url_stat *us, char *flags) int cd; /* get the proxy URL, and check if we should use HTTP instead */ - if (!strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL) { + if (flags && !strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL) { if (strcasecmp(purl->scheme, SCHEME_HTTP) == 0) { FILE *f; |