Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/config Fix segmentation fault.
details: https://anonhg.NetBSD.org/src/rev/7465802c992e
branches: trunk
changeset: 340432:7465802c992e
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Fri Sep 04 15:50:48 2015 +0000
description:
Fix segmentation fault.
diffstat:
usr.bin/config/files.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r d310ad8abb0e -r 7465802c992e usr.bin/config/files.c
--- a/usr.bin/config/files.c Fri Sep 04 12:27:36 2015 +0000
+++ b/usr.bin/config/files.c Fri Sep 04 15:50:48 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: files.c,v 1.33 2015/09/04 10:16:35 uebayasi Exp $ */
+/* $NetBSD: files.c,v 1.34 2015/09/04 15:50:48 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,9 +45,10 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: files.c,v 1.33 2015/09/04 10:16:35 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.34 2015/09/04 15:50:48 uebayasi Exp $");
#include <sys/param.h>
+#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -379,6 +380,8 @@
continue;
selfiles[i++] = fi;
}
+ assert(i <= nselfiles);
+ nselfiles = i;
qsort(selfiles, nselfiles, (unsigned)sizeof(fi), cmpfiles);
return (err);
}
Home |
Main Index |
Thread Index |
Old Index