summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-06-13 16:53:24 +0300
committerEli Zaretskii <eliz@gnu.org>2014-06-13 16:53:24 +0300
commit4346235f61172f2c55dfbbd2b830233e005987e7 (patch)
tree442e1e7d1d75203e10e8a1002f7bb938be1cca3a /src
parent0071d45b616f0e533818e65cc7307fbe4bd2a282 (diff)
downloademacs-4346235f61172f2c55dfbbd2b830233e005987e7.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/alloc.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3468cea6159..87b9b32510e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-13 Eli Zaretskii <eliz@gnu.org>
+
+ * alloc.c (cleanup_vector): Don't dereference a font driver
+ pointer if it is NULL. (Bug#17771)
+
2014-06-11 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_cursor_from_row): Fix an off-by-one error when
diff --git a/src/alloc.c b/src/alloc.c
index 12b3d4ba165..a3f3f5478cb 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2924,9 +2924,16 @@ cleanup_vector (struct Lisp_Vector *vector)
&& ((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);
+ }
}
}