make sure gl_pathc != 0 before referencing gl_pathv

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10900 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-04-02 11:57:39 +00:00
parent d3885e616b
commit 2200a93e81

View File

@@ -148,7 +148,9 @@ ftpd_popen(char *program, char *type, int do_stderr, int no_glob)
;
memset(&gl, 0, sizeof(gl));
if (no_glob || glob(argv[argc], flags, NULL, &gl))
if (no_glob ||
glob(argv[argc], flags, NULL, &gl) ||
gl.gl_pathc == 0)
gargv[gargc++] = strdup(argv[argc]);
else
for (pop = gl.gl_pathv;