Fix crashes on MS-Windows during dumping
commit0757b4f2f73daa67e5c5217964b423c6a0239e95
authorEli Zaretskii <eliz@gnu.org>
Sat, 17 Dec 2016 11:08:52 +0000 (17 13:08 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 17 Dec 2016 11:08:52 +0000 (17 13:08 +0200)
treeabf4bc0accf7a0f0202e9ad88401d2d2ee4796ea
parent6bf83218314db1c63ce34564edfb994d9431b28a
Fix crashes on MS-Windows during dumping

* src/unexw32.c (get_section_info): Make extra_bss_size be the
maximum of extra_bss_size and extra_bss_size_static.  This avoids
computing the size of the output file smaller than it actually
needs to be, which then causes copy_executable_and_dump_data to
write beyond the requested size of the file mapping, thus relying
on the OS roundup to page boundary to save us from ourselves.  See
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html
for the details.

* lib/stdio-impl.h: Revert the workaround fix of not including
errno.h for MinGW.
lib/stdio-impl.h
src/unexw32.c