[openssh-commits] [openssh] 03/08: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 15 16:09:08 AEDT 2019


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit fd37cdeafe25adfcdc752280f535d28de7997ff1
Author: Damien Miller <djm at mindrot.org>
Date:   Fri Nov 15 16:02:27 2019 +1100

    upstream commit
    
    revision 1.43
    date: 2015/06/13 16:57:04;  author: deraadt;  state: Exp;  lines: +4 -4;  commitid: zOUKuqWBdOPOz1SZ;
    in glob() initialize the glob_t before the first failure check.
    from j at pureftpd.org
    ok millert stsp
---
 openbsd-compat/glob.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c
index e9026597..d4e052fa 100644
--- a/openbsd-compat/glob.c
+++ b/openbsd-compat/glob.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: glob.c,v 1.42 2015/02/05 12:59:57 millert Exp $ */
+/*	$OpenBSD: glob.c,v 1.43 2015/06/13 16:57:04 deraadt Exp $ */
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -186,9 +186,6 @@ glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
 	Char *bufnext, *bufend, patbuf[PATH_MAX];
 	struct glob_lim limit = { 0, 0, 0 };
 
-	if (strnlen(pattern, PATH_MAX) == PATH_MAX)
-		return(GLOB_NOMATCH);
-
 	patnext = (u_char *) pattern;
 	if (!(flags & GLOB_APPEND)) {
 		pglob->gl_pathc = 0;
@@ -201,6 +198,9 @@ glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
 	pglob->gl_errfunc = errfunc;
 	pglob->gl_matchc = 0;
 
+	if (strnlen(pattern, PATH_MAX) == PATH_MAX)
+		return(GLOB_NOMATCH);
+
 	if (pglob->gl_offs < 0 || pglob->gl_pathc < 0 ||
 	    pglob->gl_offs >= INT_MAX || pglob->gl_pathc >= INT_MAX ||
 	    pglob->gl_pathc >= INT_MAX - pglob->gl_offs - 1)

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list