diff options
author | ru <ru@FreeBSD.org> | 2010-01-06 08:26:43 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2010-01-06 08:26:43 +0000 |
commit | 1e752637963ea42879d3865794977a77e0c72129 (patch) | |
tree | 6ba40b3fb38797822c568411eaeff30cf479999d /usr.bin/fetch/fetch.c | |
parent | 4e0b0a91861056a9a355a0894d474a96812859f6 (diff) | |
download | FreeBSD-src-1e752637963ea42879d3865794977a77e0c72129.zip FreeBSD-src-1e752637963ea42879d3865794977a77e0c72129.tar.gz |
MFC r201290: Treat an empty argument as an error, instead of
fetching the contents of the root directory.
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r-- | usr.bin/fetch/fetch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 2512a2e..7553bd8 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -340,6 +340,11 @@ fetch(char *URL, const char *path) fetchDebug = 1; /* parse URL */ + url = NULL; + if (*URL == '\0') { + warnx("empty URL"); + goto failure; + } if ((url = fetchParseURL(URL)) == NULL) { warnx("%s: parse error", URL); goto failure; |