diff options
author | ru <ru@FreeBSD.org> | 2009-12-30 23:01:49 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2009-12-30 23:01:49 +0000 |
commit | c056a4415da4cfa7c0dfa135980513b773bfccea (patch) | |
tree | fd6a56f55e265599f6dde4e6a2a3da595b87ffb2 | |
parent | 1126c5fc83d25cb91e0ba91526c39727eebf98b1 (diff) | |
download | FreeBSD-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
-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; |