mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Shrink STRING_BYTES_MAX slightly
* src/alloc.c (STRING_BYTES_MAX): Also don’t allow sizes to exceed PTRDIFF_MAX in internal calculations when calling malloc, as those are problematic even if the final number of bytes does not exceed PTRDIFF_MAX.
This commit is contained in:
parent
59b2f8f1dc
commit
9851c5ea34
1 changed files with 1 additions and 1 deletions
|
|
@ -1501,7 +1501,7 @@ sdata_size (ptrdiff_t n)
|
|||
calculating a value to be passed to malloc. */
|
||||
static ptrdiff_t const STRING_BYTES_MAX =
|
||||
min (STRING_BYTES_BOUND,
|
||||
((SIZE_MAX
|
||||
((min (PTRDIFF_MAX, SIZE_MAX)
|
||||
- GC_STRING_EXTRA
|
||||
- offsetof (struct sblock, data)
|
||||
- SDATA_DATA_OFFSET)
|
||||
|
|
|
|||
Loading…
Reference in a new issue