summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2009-12-30 23:01:49 +0000
committerru <ru@FreeBSD.org>2009-12-30 23:01:49 +0000
commitc056a4415da4cfa7c0dfa135980513b773bfccea (patch)
treefd6a56f55e265599f6dde4e6a2a3da595b87ffb2 /usr.bin/fetch
parent1126c5fc83d25cb91e0ba91526c39727eebf98b1 (diff)
downloadFreeBSD-src-c056a4415da4cfa7c0dfa135980513b773bfccea.zip
FreeBSD-src-c056a4415da4cfa7c0dfa135980513b773bfccea.tar.gz
Treat an empty argument as an error, instead of fetching the
contents of the root directory. MFC after: 1 week
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/fetch.c5
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;
OpenPOWER on IntegriCloud