emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 07a3386 1/3: Limit insert-file-contents to MAX_ALLO


From: Paul Eggert
Subject: [Emacs-diffs] master 07a3386 1/3: Limit insert-file-contents to MAX_ALLOCA
Date: Wed, 21 Jun 2017 20:28:03 -0400 (EDT)

branch: master
commit 07a3386fbb4e180f017fab11ea963f4f34493f3c
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 src/fileio.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/fileio.c b/src/fileio.c
index c21056e..cb07002 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]