]> code.delx.au - gnu-emacs/commitdiff
Fix w32 memory-management problem when extending buffer text
authorEli Zaretskii <eliz@gnu.org>
Fri, 15 Apr 2016 14:26:37 +0000 (17:26 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 15 Apr 2016 14:26:37 +0000 (17:26 +0300)
* src/w32heap.c (mmap_realloc): Only attempt extending a region if
the following region has the same allocation base.  Also, use the
original allocation base and enlarged size to commit reserved
memory, to ensure that the allocation base stays at its original
value.  This fixes several hard-to-debug problems whereby part of
buffer text was overwritten with binary nulls, because
mmap_realloc copied only part of buffer text when extending it.
See
http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00325.html
and http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23223#55 for two
examples of the related problems.


No differences found