emacs-devel
[Top][All Lists]
Advanced

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

Re: RFC on proposal fix [Re: Crash caused by insert-file-contents, both


From: Dmitry Antipov
Subject: Re: RFC on proposal fix [Re: Crash caused by insert-file-contents, both trunk (bzr 111532) and 24.2.92 affected]
Date: Thu, 17 Jan 2013 22:12:24 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

On 01/17/2013 09:50 PM, Eli Zaretskii wrote:

Can you tell which problems you found in the original code that these
changes are supposed to fix?

1) Original code do emacs_read to ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + 
offset
   without adjusting gap size, z and zv; this (IIUC) fools make_gap and so
   enlarge_buffer_text; we end up with the gap which is less than expected,
   read_non_regular do emacs_read into the buffer beyond allocated buffer text,
   which finally causes EFAULT from emacs_read or heap corruption.

2) Original code throws I/O error too early without decoding the data possibly
   read before. When not-yet-decoded part of buffer text is displayed, redisplay
   is likely to crash.

Dmitry




reply via email to

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