diff options
| author | Eli Zaretskii | 2013-12-14 11:16:10 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-12-14 11:16:10 +0200 |
| commit | 95c216526e3700d46319d8fb47844a5e07662bbf (patch) | |
| tree | e71678149f7461657b1ee4a483a83692bb2aafc0 /src | |
| parent | 0b32070bbd13c8f19be93185172e985213972d7b (diff) | |
| download | emacs-95c216526e3700d46319d8fb47844a5e07662bbf.tar.gz emacs-95c216526e3700d46319d8fb47844a5e07662bbf.zip | |
Avoid crashing due to closing of font whose driver pointer is NULL.
src/alloc.c (cleanup_vector): Don't call the font driver's 'close'
method if the 'driver' pointer is NULL.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/alloc.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index df145600556..a9672768b48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-12-14 Eli Zaretskii <eliz@gnu.org> | 1 | 2013-12-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * alloc.c (cleanup_vector): Don't call the font driver's 'close' | ||
| 4 | method if the 'driver' pointer is NULL. | ||
| 5 | |||
| 3 | * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the | 6 | * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the |
| 4 | Windows-specific code to w32.c. Change error message text to | 7 | Windows-specific code to w32.c. Change error message text to |
| 5 | match that of Posix platforms. | 8 | match that of Posix platforms. |
diff --git a/src/alloc.c b/src/alloc.c index aeda42637cd..1cf0f3cc1d2 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2877,7 +2877,12 @@ cleanup_vector (struct Lisp_Vector *vector) | |||
| 2877 | if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) | 2877 | if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) |
| 2878 | && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) | 2878 | && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) |
| 2879 | == FONT_OBJECT_MAX)) | 2879 | == FONT_OBJECT_MAX)) |
| 2880 | ((struct font *) vector)->driver->close ((struct font *) vector); | 2880 | { |
| 2881 | struct font *fnt = (struct font *) vector; | ||
| 2882 | |||
| 2883 | if (fnt->driver) | ||
| 2884 | fnt->driver->close ((struct font *) vector); | ||
| 2885 | } | ||
| 2881 | } | 2886 | } |
| 2882 | 2887 | ||
| 2883 | /* Reclaim space used by unmarked vectors. */ | 2888 | /* Reclaim space used by unmarked vectors. */ |