summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2010-03-20 18:23:30 +0000
committerchristos <christos@NetBSD.org>2010-03-20 18:23:30 +0000
commit692b0132a0a6018c3dafeb690b28aecc2e25c050 (patch)
tree0f4db71fa9493bbd034b96b28b107176f297605a /libexec
parent56bf19aaea486c5f97ea3339ee79b535108c0f67 (diff)
PR/43023: Bruce Cran: FTPD bug remote crash
Since we specify NOCHECK, in the NOMATCH case gl_pathv can be NULL. (From FreeBSD)
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/popen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c
index 5b000d97a9f..ed52dc0948f 100644
--- a/libexec/ftpd/popen.c
+++ b/libexec/ftpd/popen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: popen.c,v 1.36 2009/03/18 02:27:41 lukem Exp $ */
+/* $NetBSD: popen.c,v 1.37 2010/03/20 18:23:30 christos Exp $ */
/*-
* Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
#if 0
static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94";
#else
-__RCSID("$NetBSD: popen.c,v 1.36 2009/03/18 02:27:41 lukem Exp $");
+__RCSID("$NetBSD: popen.c,v 1.37 2010/03/20 18:23:30 christos Exp $");
#endif
#endif /* not lint */
@@ -139,7 +139,8 @@ ftpd_popen(const char *argv[], const char *ptype, int stderrfd)
int flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE|GLOB_LIMIT;
memset(&gl, 0, sizeof(gl));
- if (glob(argv[argc], flags, NULL, &gl)) {
+ if (glob(argv[argc], flags, NULL, &gl)
+ || gl.gl_pathv == NULL) {
if (sl_add(sl, ftpd_strdup(argv[argc])) == -1) {
globfree(&gl);
goto pfree;