From: Paul Eggert Date: Tue, 6 Sep 2011 15:27:16 +0000 (-0700) Subject: Merge from trunk. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b2db44d9c6b6895222e9de5ab58b3897fdb3c889;p=emacs.git Merge from trunk. --- b2db44d9c6b6895222e9de5ab58b3897fdb3c889 diff --cc src/ChangeLog index 88065dd3231,6319c53209c..e1bdfedbd31 --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,22 -1,3 +1,22 @@@ - 2011-09-05 Paul Eggert ++2011-09-06 Paul Eggert + + * fileio.c: Fix bugs with large file offsets (Bug#9428). + The previous code assumed that file offsets (off_t values) fit in + EMACS_INT variables, which is not true on typical 32-bit hosts. + The code messed up by falsely reporting buffer overflow in cases + such as (insert-file-contents "big" nil 1 2) into an empty buffer + when "big" contains more than 2**29 bytes, even though this + inserts just one byte and does not overflow the buffer. + (Finsert_file_contents): Store file offsets as off_t + values, not as EMACS_INT values. Check for overflow when + converting between EMACS_INT and off_t. When checking for + buffer overflow or for overlap, take the offsets into account. + Don't use EMACS_INT for small values where int suffices. + When checking for overlap, fix a typo: ZV was used where + ZV_BYTE was intended. + (Fwrite_region): Don't assume off_t fits into 'long'. + * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT. + 2011-09-05 Michael Albinus * dbusbind.c (xd_signature_cat): Rename from signature_cat.