From 15acfe419fe1ca82c0a806c600a7e6d000cd56a5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 7 May 2013 15:15:08 -0400 Subject: [PATCH] * src/lread.c (readchar): Don't read from a dead buffer. (Bug#14280) --- src/ChangeLog | 4 ++++ src/lread.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 4b71eed9c21..cfa10f7bfb2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-05-07 Glenn Morris + + * lread.c (readchar): Don't read from a dead buffer. (Bug#14280) + 2013-05-07 Jan Djärv * xfns.c: Move misplaced ifndef USE_GTK from previous checkin. diff --git a/src/lread.c b/src/lread.c index 1a8a57e57a7..272f252cf7b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -201,6 +201,9 @@ readchar (Lisp_Object readcharfun, bool *multibyte) ptrdiff_t pt_byte = BUF_PT_BYTE (inbuffer); + if (! BUFFER_LIVE_P (inbuffer)) + return -1; + if (pt_byte >= BUF_ZV_BYTE (inbuffer)) return -1; -- 2.39.2