diff src/dumper.c @ 2698:d8df26f08486

[xemacs-hg @ 2005-03-29 02:52:42 by james] Fix off-by-one error possibly causing backtrace overflow. See xemacs-patches message with ID <psbr954s83.fsf@diannao.ittc.ku.edu>.
author james
date Tue, 29 Mar 2005 02:52:50 +0000
parents 6bee993389f3
children 6fa9919a9a0b
line wrap: on
line diff
--- a/src/dumper.c	Mon Mar 28 21:51:30 2005 +0000
+++ b/src/dumper.c	Tue Mar 29 02:52:50 2005 +0000
@@ -520,12 +520,14 @@
   return 0;
 }
 
+#define BACKTRACE_MAX 65536
+
 static struct
 {
   struct lrecord_header *obj;
   int position;
   int offset;
-} backtrace[65536];
+} backtrace[BACKTRACE_MAX];
 
 static int pdump_depth;
 
@@ -568,7 +570,7 @@
 pdump_bump_depth (void)
 {
   int me = pdump_depth++;
-  if (me > 65536)
+  if (me >= BACKTRACE_MAX)
     {
       stderr_out ("Backtrace overflow, loop ?\n");
       ABORT ();