From: Paul Eggert Date: Thu, 22 Jun 2017 00:15:49 +0000 (-0700) Subject: Limit insert-file-contents to MAX_ALLOCA X-Git-Tag: emacs-26.0.90~521^2~21 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=07a3386fbb4e180f017fab11ea963f4f34493f3c;p=emacs.git Limit insert-file-contents to MAX_ALLOCA * src/fileio.c (READ_BUF_SIZE): Don’t allocate more than MAX_ALLOCA bytes in a single stack array. --- diff --git a/src/fileio.c b/src/fileio.c index c21056ee6f2..cb070029a9b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3306,11 +3306,7 @@ otherwise, if FILE2 does not exist, the answer is t. */) ? Qt : Qnil); } -#ifndef READ_BUF_SIZE -#define READ_BUF_SIZE (64 << 10) -#endif -/* Some buffer offsets are stored in 'int' variables. */ -verify (READ_BUF_SIZE <= INT_MAX); +enum { READ_BUF_SIZE = MAX_ALLOCA }; /* This function is called after Lisp functions to decide a coding system are called, or when they cause an error. Before they are