]> git.eshelyaron.com Git - emacs.git/commitdiff
* syntax.c (scan_sexps_forward): Avoid pointer wraparound.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Mar 2011 08:21:49 +0000 (01:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Mar 2011 08:21:49 +0000 (01:21 -0700)
src/ChangeLog
src/syntax.c

index 3d917d0e5a4d5b74749701efc73a6654a6664c2a..8704ba4b9041b2b00068b0e523316c6f175af289 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-27  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
+
        * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
        concerns.
 
index c1442c396c1be918797a4f7eb9743d56f0308278..0a1525b54eac67be503f420de44e0f76a9997ecf 100644 (file)
@@ -3265,9 +3265,9 @@ do { prev_from = from;                            \
     = (curlevel == levelstart) ? -1 : (curlevel - 1)->last;
   state.location = from;
   state.levelstarts = Qnil;
-  while (--curlevel >= levelstart)
-      state.levelstarts = Fcons (make_number (curlevel->last),
-                                state.levelstarts);
+  while (curlevel > levelstart)
+    state.levelstarts = Fcons (make_number ((--curlevel)->last),
+                              state.levelstarts);
   immediate_quit = 0;
 
   *stateptr = state;