summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2007-04-10 04:45:38 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2007-04-10 04:45:38 +0000
commitb7caa5ee2da7cd4019aef92aec7794976377dc28 (patch)
tree91f4e4cb323aafd632b5e11a85e6f36cb0fbbdb1 /sbin
parent0d9b8716055debf17e17dd3dc55598d6a1fa1a6f (diff)
Rewrite ITITERATE macro to prevent out-of-bounds memory access.
This makes dump -u work with malloc debugging enabled. ok millert@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dump/dump.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h
index 9ad0c7a14e5..b15835dcab8 100644
--- a/sbin/dump/dump.h
+++ b/sbin/dump/dump.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.h,v 1.14 2003/08/25 23:28:15 tedu Exp $ */
+/* $OpenBSD: dump.h,v 1.15 2007/04/10 04:45:37 moritz Exp $ */
/* $NetBSD: dump.h,v 1.11 1997/06/05 11:13:20 lukem Exp $ */
/*-
@@ -173,7 +173,7 @@ void initdumptimes(void);
void getdumptime(void);
void putdumptime(void);
#define ITITERATE(i, ddp) \
- for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
+ for (i = 0; i < nddates && (ddp = ddatev[i]); i++)
void sig(int signo);