diff options
Diffstat (limited to 'src/character.c')
-rw-r--r-- | src/character.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/character.c b/src/character.c index 5e2eccf54db..50b5b252871 100644 --- a/src/character.c +++ b/src/character.c @@ -902,6 +902,8 @@ usage: (string &rest CHARACTERS) */) Lisp_Object str; USE_SAFE_ALLOCA; + if (min (PTRDIFF_MAX, SIZE_MAX) / MAX_MULTIBYTE_LENGTH < n) + memory_full (SIZE_MAX); SAFE_ALLOCA (buf, unsigned char *, MAX_MULTIBYTE_LENGTH * n); p = buf; |