diff options
| author | Paul Eggert | 2017-06-21 17:15:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-06-21 17:27:58 -0700 |
| commit | 07a3386fbb4e180f017fab11ea963f4f34493f3c (patch) | |
| tree | c81385849535fecc9b9a8322a2377384f0a49fe9 | |
| parent | b7dfd39c8b2ebd127e83d84b9df48be173bc0134 (diff) | |
| download | emacs-07a3386fbb4e180f017fab11ea963f4f34493f3c.tar.gz emacs-07a3386fbb4e180f017fab11ea963f4f34493f3c.zip | |
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.
| -rw-r--r-- | src/fileio.c | 6 |
1 files changed, 1 insertions, 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. */) | |||
| 3306 | ? Qt : Qnil); | 3306 | ? Qt : Qnil); |
| 3307 | } | 3307 | } |
| 3308 | 3308 | ||
| 3309 | #ifndef READ_BUF_SIZE | 3309 | enum { READ_BUF_SIZE = MAX_ALLOCA }; |
| 3310 | #define READ_BUF_SIZE (64 << 10) | ||
| 3311 | #endif | ||
| 3312 | /* Some buffer offsets are stored in 'int' variables. */ | ||
| 3313 | verify (READ_BUF_SIZE <= INT_MAX); | ||
| 3314 | 3310 | ||
| 3315 | /* This function is called after Lisp functions to decide a coding | 3311 | /* This function is called after Lisp functions to decide a coding |
| 3316 | system are called, or when they cause an error. Before they are | 3312 | system are called, or when they cause an error. Before they are |