emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107873: Fix bug #11288 with overr


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107873: Fix bug #11288 with overrunning array limits.
Date: Fri, 20 Apr 2012 17:08:55 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107873
fixes bug(s): http://debbugs.gnu.org/11288
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-04-20 17:08:55 +0300
message:
  Fix bug #11288 with overrunning array limits.
  
   src/dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't
   overrun array limits of glyph row's used[] array.
modified:
  src/ChangeLog
  src/dispnew.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-04-20 06:39:29 +0000
+++ b/src/ChangeLog     2012-04-20 14:08:55 +0000
@@ -1,3 +1,8 @@
+2012-04-20  Eli Zaretskii  <address@hidden>
+
+       * dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't
+       overrun array limits of glyph row's used[] array.  (Bug#11288)
+
 2012-04-20  Chong Yidong  <address@hidden>
 
        * process.c (wait_reading_process_output): If EIO occurs on a pty,

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2012-03-20 08:52:11 +0000
+++ b/src/dispnew.c     2012-04-20 14:08:55 +0000
@@ -1085,12 +1085,16 @@
   for (i = 0; i < LAST_AREA + 1; ++i)
     {
       struct glyph *temp = a->glyphs[i];
-      short used_tem = a->used[i];
 
       a->glyphs[i] = b->glyphs[i];
       b->glyphs[i] = temp;
-      a->used[i] = b->used[i];
-      b->used[i] = used_tem;
+      if (i < LAST_AREA)
+       {
+         short used_tem = a->used[i];
+
+         a->used[i] = b->used[i];
+         b->used[i] = used_tem;
+       }
     }
   a->hash = b->hash;
   b->hash = hash_tem;
@@ -1105,7 +1109,7 @@
 copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
 {
   struct glyph *pointers[1 + LAST_AREA];
-  short used[1 + LAST_AREA];
+  short used[LAST_AREA];
   unsigned hashval;
 
   /* Save glyph pointers of TO.  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]