Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2009 23:01:49 +0000 (UTC)
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201290 - head/usr.bin/fetch
Message-ID:  <200912302301.nBUN1nE5075671@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ru
Date: Wed Dec 30 23:01:49 2009
New Revision: 201290
URL: http://svn.freebsd.org/changeset/base/201290

Log:
  Treat an empty argument as an error, instead of fetching the
  contents of the root directory.
  
  MFC after:	1 week

Modified:
  head/usr.bin/fetch/fetch.c

Modified: head/usr.bin/fetch/fetch.c
==============================================================================
--- head/usr.bin/fetch/fetch.c	Wed Dec 30 22:46:08 2009	(r201289)
+++ head/usr.bin/fetch/fetch.c	Wed Dec 30 23:01:49 2009	(r201290)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912302301.nBUN1nE5075671>