Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ffs fix an off by one array overflow found by GCC 4....
details: https://anonhg.NetBSD.org/src/rev/2aa5395a9ef9
branches: trunk
changeset: 766417:2aa5395a9ef9
user: mrg <mrg%NetBSD.org@localhost>
date: Wed Jun 22 04:01:33 2011 +0000
description:
fix an off by one array overflow found by GCC 4.5.3.
diffstat:
sys/ufs/ffs/ffs_appleufs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 88d1e9d82d30 -r 2aa5395a9ef9 sys/ufs/ffs/ffs_appleufs.c
--- a/sys/ufs/ffs/ffs_appleufs.c Wed Jun 22 04:01:08 2011 +0000
+++ b/sys/ufs/ffs/ffs_appleufs.c Wed Jun 22 04:01:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_appleufs.c,v 1.10 2010/04/24 19:58:13 dbj Exp $ */
+/* $NetBSD: ffs_appleufs.c,v 1.11 2011/06/22 04:01:33 mrg Exp $ */
/*
* Copyright (c) 2002 Darrin B. Jewell
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_appleufs.c,v 1.10 2010/04/24 19:58:13 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_appleufs.c,v 1.11 2011/06/22 04:01:33 mrg Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -108,7 +108,7 @@
n->ul_namelen = APPLEUFS_MAX_LABEL_NAME;
}
/* if len is max, will set ul_unused1 */
- n->ul_name[n->ul_namelen] = '\0';
+ n->ul_name[n->ul_namelen - 1] = '\0';
#ifdef DEBUG
printf("%s: found APPLE UFS label v%d: \"%s\"\n",
Home |
Main Index |
Thread Index |
Old Index