Module Name:    src
Committed By:   christos
Date:           Tue Nov 19 16:42:16 UTC 2013

Modified Files:
        src/usr.sbin/ldpd: conffile.c

Log Message:
CVE 1129617: negative arg


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/ldpd/conffile.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.sbin/ldpd/conffile.c
diff -u src/usr.sbin/ldpd/conffile.c:1.10 src/usr.sbin/ldpd/conffile.c:1.11
--- src/usr.sbin/ldpd/conffile.c:1.10	Wed Nov 13 16:22:46 2013
+++ src/usr.sbin/ldpd/conffile.c	Tue Nov 19 11:42:16 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: conffile.c,v 1.10 2013/11/13 21:22:46 christos Exp $ */
+/* $NetBSD: conffile.c,v 1.11 2013/11/19 16:42:16 christos Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -122,7 +122,8 @@ conf_parsefile(const char *fname)
 	if (confh == -1 || fstat(confh, &fs) == -1 ||
 	    (mapped = mmap(NULL, fs.st_size, PROT_READ, MAP_SHARED, confh, 0))
 	    == MAP_FAILED) {
-		close(confh);
+		if (confh != -1)
+			close(confh);
 		return E_CONF_IO;
 	}
 

Reply via email to