Module Name:    src
Committed By:   christos
Date:           Sat Mar  9 16:18:22 UTC 2019

Modified Files:
        src/usr.bin/cvslatest: Makefile cvslatest.c

Log Message:
Fix another bug found by jemalloc: don't access dirent entry after closedir(3).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/cvslatest/Makefile
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/cvslatest/cvslatest.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/cvslatest/Makefile
diff -u src/usr.bin/cvslatest/Makefile:1.1 src/usr.bin/cvslatest/Makefile:1.2
--- src/usr.bin/cvslatest/Makefile:1.1	Sun Jan 24 12:08:16 2016
+++ src/usr.bin/cvslatest/Makefile	Sat Mar  9 11:18:22 2019
@@ -1,6 +1,7 @@
-#	$NetBSD: Makefile,v 1.1 2016/01/24 17:08:16 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2019/03/09 16:18:22 christos Exp $
 
 WARNS=6
 PROG=	cvslatest
+DBG=-g
 
 .include <bsd.prog.mk>

Index: src/usr.bin/cvslatest/cvslatest.c
diff -u src/usr.bin/cvslatest/cvslatest.c:1.7 src/usr.bin/cvslatest/cvslatest.c:1.8
--- src/usr.bin/cvslatest/cvslatest.c:1.7	Sun Mar 11 10:59:41 2018
+++ src/usr.bin/cvslatest/cvslatest.c	Sat Mar  9 11:18:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cvslatest.c,v 1.7 2018/03/11 14:59:41 christos Exp $	*/
+/*	$NetBSD: cvslatest.c,v 1.8 2019/03/09 16:18:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cvslatest.c,v 1.7 2018/03/11 14:59:41 christos Exp $");
+__RCSID("$NetBSD: cvslatest.c,v 1.8 2019/03/09 16:18:22 christos Exp $");
 
 /*
  * Find the latest timestamp in a set of CVS trees, by examining the
@@ -212,8 +212,8 @@ findCVSDir(char *path, size_t pathlen, c
 	}
 	n = "CVS";
 out:
-	closedir(dirp);
 	strlcpy(path, n, pathlen);
+	closedir(dirp);
 	return path;
 }
 

Reply via email to