* composite.c: Don't truncate sizes to 'int'.
[bpt/emacs.git] / src / ChangeLog
index 011f5be..6ff0fe4 100644 (file)
@@ -1,5 +1,37 @@
+2011-06-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * composite.c: Don't truncate sizes to 'int'.
+       (composition_gstring_p, composition_reseat_it)
+       (composition_adjust_point): Use EMACS_INT, not int.
+
+       * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
+
+       * buffer.c: Include <verify.h>.
+       (struct sortvec.priority, struct sortstr.priority):
+       Now EMACS_INT, not int.
+       (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
+       (struct sortstr.size, record_overlay_string)
+       (struct sortstrlist.size, struct sortlist.used):
+       Don't truncate size to int.
+       (record_overlay_string): Check for size-calculation overflow.
+       (init_buffer_once): Check at compile-time, not run-time.
+
 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
+       Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
+       hosts with pre-C99 libraries, because pD is wrongly defined to "t".
+
+       Improve buffer-overflow checking (Bug#8873).
+       * fileio.c (Finsert_file_contents):
+       * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
+       Remove the old (too-loose) buffer overflow checks.
+       They weren't needed, since make_gap checks for buffer overflow.
+       * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
+       The old code merely checked for Emacs fixnum overflow, and relied
+       on undefined (wraparound) behavior.  The new code avoids undefined
+       behavior, and also checks for ptrdiff_t and/or size_t overflow.
+
        * editfns.c (Finsert_char): Don't dump core with very negative counts.
        Tune.  Don't use wider integers than needed.  Don't use alloca.
        Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
 
        * menu.c: Include limits.h (fixes the MS-Windows build broken by
-       revision 104625).
+       2011-06-18T18:49:19Z!cyd@stupidchicken.com).
 
 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>