From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 23:01:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B02106566C; Wed, 30 Dec 2009 23:01:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21388FC08; Wed, 30 Dec 2009 23:01:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUN1n02075673; Wed, 30 Dec 2009 23:01:49 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUN1nE5075671; Wed, 30 Dec 2009 23:01:49 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912302301.nBUN1nE5075671@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 30 Dec 2009 23:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201290 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 23:01:50 -0000 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;