From 07a3386fbb4e180f017fab11ea963f4f34493f3c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 21 Jun 2017 17:15:49 -0700 Subject: [PATCH] Limit insert-file-contents to MAX_ALLOCA MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/fileio.c (READ_BUF_SIZE): Don’t allocate more than MAX_ALLOCA bytes in a single stack array. --- src/fileio.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 -- 2.39.2