mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-23 18:47:57 +00:00
(make_gap): Don't allow buffer size that won't fit in int.
This commit is contained in:
parent
34b4ece5fe
commit
94056516e2
@ -271,6 +271,14 @@ make_gap (increment)
|
||||
/* If we have to get more space, get enough to last a while. */
|
||||
increment += 2000;
|
||||
|
||||
/* Don't allow a buffer size that won't fit in an int
|
||||
even if it will fit in a Lisp integer.
|
||||
That won't work because so many places use `int'. */
|
||||
|
||||
if (VALBITS > INTBITS
|
||||
&& (Z - BEG + GAP_SIZE + increment) >= ((unsigned) 1 << (INTBITS - 1)))
|
||||
error ("Buffer too big");
|
||||
|
||||
BLOCK_INPUT;
|
||||
result = BUFFER_REALLOC (BEG_ADDR, (Z - BEG + GAP_SIZE + increment));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user