emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117235: Attempt to fix bug #17771 with segfault


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117235: Attempt to fix bug #17771 with segfault if "C-h h" is interrupted.
Date: Fri, 13 Jun 2014 13:54:25 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117235
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17771
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-06-13 16:53:24 +0300
message:
  Attempt to fix bug #17771 with segfault if "C-h h" is interrupted.
  
   src/alloc.c (cleanup_vector): Don't dereference a font driver
   pointer if it is NULL.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/alloc.c                    alloc.c-20091113204419-o5vbwnq5f7feedwu-252
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-06-11 16:11:32 +0000
+++ b/src/ChangeLog     2014-06-13 13:53:24 +0000
@@ -1,3 +1,8 @@
+2014-06-13  Eli Zaretskii  <address@hidden>
+
+       * alloc.c (cleanup_vector): Don't dereference a font driver
+       pointer if it is NULL.  (Bug#17771)
+
 2014-06-11  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (set_cursor_from_row): Fix an off-by-one error when

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2014-05-30 20:19:29 +0000
+++ b/src/alloc.c       2014-06-13 13:53:24 +0000
@@ -2924,9 +2924,16 @@
       && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK)
          == FONT_OBJECT_MAX))
     {
-      /* Attempt to catch subtle bugs like Bug#16140.  */
-      eassert (valid_font_driver (((struct font *) vector)->driver));
-      ((struct font *) vector)->driver->close ((struct font *) vector);
+      struct font_driver *drv = ((struct font *) vector)->driver;
+
+      /* The font driver might sometimes be NULL, e.g. if Emacs was
+        interrupted before it had time to set it up.  */
+      if (drv)
+       {
+         /* Attempt to catch subtle bugs like Bug#16140.  */
+         eassert (valid_font_driver (drv));
+         drv->close ((struct font *) vector);
+       }
     }
 }
 


reply via email to

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