Source-Changes-HG archive

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

[src/trunk]: src/libexec/ftpd PR/50665: David Binderman: move "dir" to the ou...



details:   https://anonhg.NetBSD.org/src/rev/95ca6c08d8e8
branches:  trunk
changeset: 342989:95ca6c08d8e8
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 17 14:46:07 2016 +0000

description:
PR/50665: David Binderman: move "dir" to the outer scope so it stays alive
when the pointer is used later.

diffstat:

 libexec/ftpd/cmds.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 9d04d589333d -r 95ca6c08d8e8 libexec/ftpd/cmds.c
--- a/libexec/ftpd/cmds.c       Sun Jan 17 11:24:28 2016 +0000
+++ b/libexec/ftpd/cmds.c       Sun Jan 17 14:46:07 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmds.c,v 1.34 2015/08/10 07:32:49 shm Exp $    */
+/*     $NetBSD: cmds.c,v 1.35 2016/01/17 14:46:07 christos Exp $       */
 
 /*
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: cmds.c,v 1.34 2015/08/10 07:32:49 shm Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.35 2016/01/17 14:46:07 christos Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -600,7 +600,7 @@
 fact_perm(const char *fact, FILE *fd, factelem *fe)
 {
        int             rok, wok, xok, pdirwok;
-       struct stat     *pdir;
+       struct stat     *pdir, dir;
 
        if (fe->stat->st_uid == geteuid()) {
                rok = ((fe->stat->st_mode & S_IRUSR) != 0);
@@ -627,7 +627,6 @@
        if (pdir == NULL && CURCLASS_FLAGS_ISSET(modify)) {
                size_t          len;
                char            realdir[MAXPATHLEN], *p;
-               struct stat     dir;
 
                len = strlcpy(realdir, fe->path, sizeof(realdir));
                if (len < sizeof(realdir) - 4) {



Home | Main Index | Thread Index | Old Index