Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssh/dist Add GLOB_LIMIT to the glob ...



details:   https://anonhg.NetBSD.org/src/rev/a8f8a9f34352
branches:  trunk
changeset: 756092:a8f8a9f34352
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jul 06 15:09:41 2010 +0000

description:
Add GLOB_LIMIT to the glob calls to prevent DoS attacks.

diffstat:

 crypto/external/bsd/openssh/dist/sftp-glob.c |  6 +++---
 crypto/external/bsd/openssh/dist/sftp.c      |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r 05b29d1195a5 -r a8f8a9f34352 crypto/external/bsd/openssh/dist/sftp-glob.c
--- a/crypto/external/bsd/openssh/dist/sftp-glob.c      Tue Jul 06 15:07:34 2010 +0000
+++ b/crypto/external/bsd/openssh/dist/sftp-glob.c      Tue Jul 06 15:09:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sftp-glob.c,v 1.2 2009/06/07 22:38:47 christos Exp $   */
+/*     $NetBSD: sftp-glob.c,v 1.3 2010/07/06 15:09:41 christos Exp $   */
 /* $OpenBSD: sftp-glob.c,v 1.22 2006/08/03 03:34:42 deraadt Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm%openbsd.org@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: sftp-glob.c,v 1.2 2009/06/07 22:38:47 christos Exp $");
+__RCSID("$NetBSD: sftp-glob.c,v 1.3 2010/07/06 15:09:41 christos Exp $");
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -121,5 +121,5 @@
        memset(&cur, 0, sizeof(cur));
        cur.conn = conn;
 
-       return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc, pglob));
+       return(glob(pattern, flags|GLOB_ALTDIRFUNC|GLOB_LIMIT, errfunc, pglob));
 }
diff -r 05b29d1195a5 -r a8f8a9f34352 crypto/external/bsd/openssh/dist/sftp.c
--- a/crypto/external/bsd/openssh/dist/sftp.c   Tue Jul 06 15:07:34 2010 +0000
+++ b/crypto/external/bsd/openssh/dist/sftp.c   Tue Jul 06 15:09:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sftp.c,v 1.2 2009/06/07 22:38:47 christos Exp $        */
+/*     $NetBSD: sftp.c,v 1.3 2010/07/06 15:09:41 christos Exp $        */
 /* $OpenBSD: sftp.c,v 1.107 2009/02/02 11:15:14 dtucker Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm%openbsd.org@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: sftp.c,v 1.2 2009/06/07 22:38:47 christos Exp $");
+__RCSID("$NetBSD: sftp.c,v 1.3 2010/07/06 15:09:41 christos Exp $");
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
@@ -556,7 +556,7 @@
 
        memset(&g, 0, sizeof(g));
        debug3("Looking up %s", src);
-       if (glob(src, GLOB_NOCHECK, NULL, &g)) {
+       if (glob(src, GLOB_NOCHECK|GLOB_LIMIT, NULL, &g)) {
                error("File \"%s\" not found.", src);
                err = -1;
                goto out;



Home | Main Index | Thread Index | Old Index