]> code.delx.au - gnu-emacs/commit
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)
commitab849b7fac5f7a4bb301eb830fa0acc3ad18c18f
tree22f4b149211add67e3baf27f62f73bf2890bbf29
parent1b98a68b660501c44d3a142a12ee35e3c215b05a
Fix w32 memory-management problem when extending buffer text

* 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.
src/w32heap.c