Module Name: src
Committed By: drochner
Date: Thu Aug 13 17:55:18 UTC 2009
Modified Files:
src/usr.bin/ftp: fetch.c
Log Message:
avoid NULL dereference in log output if the command line parser
failed to extract a port number from the URL
To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/ftp/fetch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.188 src/usr.bin/ftp/fetch.c:1.189
--- src/usr.bin/ftp/fetch.c:1.188 Mon Jul 13 19:05:41 2009
+++ src/usr.bin/ftp/fetch.c Thu Aug 13 17:55:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fetch.c,v 1.188 2009/07/13 19:05:41 roy Exp $ */
+/* $NetBSD: fetch.c,v 1.189 2009/08/13 17:55:18 drochner Exp $ */
/*-
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.188 2009/07/13 19:05:41 roy Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.189 2009/08/13 17:55:18 drochner Exp $");
#endif /* not lint */
/*
@@ -1498,7 +1498,8 @@
autologin = oautologin;
if ((connected == 0) ||
(connected == 1 && !ftp_login(host, uuser, pass))) {
- warnx("Can't connect or login to host `%s:%s'", host, port);
+ warnx("Can't connect or login to host `%s:%s'",
+ host, port ? port : "?");
goto cleanup_fetch_ftp;
}