diff options
| author | Stefan Monnier | 2009-03-28 02:06:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-03-28 02:06:06 +0000 |
| commit | ab226c507517f8ce23daed706f1d6e0b7369cb00 (patch) | |
| tree | 5f82a769a6213bd4aed825d585ff175df91ea888 /src | |
| parent | 46dfb8fbad2fa4dd046c877bf37baf3605b69918 (diff) | |
| download | emacs-ab226c507517f8ce23daed706f1d6e0b7369cb00.tar.gz emacs-ab226c507517f8ce23daed706f1d6e0b7369cb00.zip | |
(Finsert_file_contents): Don't limit size to INT_MAX/4.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fileio.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fa0edf01055..7e84e2f934a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-03-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * fileio.c (Finsert_file_contents): Don't limit size to INT_MAX/4. | ||
| 4 | |||
| 1 | 2009-03-27 Jan Djärv <jan.h.d@swipnet.se> | 5 | 2009-03-27 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 6 | ||
| 3 | * frame.c (x_set_font): If the fullscreen property is non-nil, adjust | 7 | * frame.c (x_set_font): If the fullscreen property is non-nil, adjust |
diff --git a/src/fileio.c b/src/fileio.c index 4f3573b02d7..93b6a1d8298 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3300,7 +3300,11 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3300 | overflow. The calculations below double the file size | 3300 | overflow. The calculations below double the file size |
| 3301 | twice, so check that it can be multiplied by 4 safely. */ | 3301 | twice, so check that it can be multiplied by 4 safely. */ |
| 3302 | if (XINT (end) != st.st_size | 3302 | if (XINT (end) != st.st_size |
| 3303 | || st.st_size > INT_MAX / 4) | 3303 | /* Actually, it should test either INT_MAX or LONG_MAX |
| 3304 | depending on which one is used for EMACS_INT. But in | ||
| 3305 | any case, in practice, this test is redundant with the | ||
| 3306 | one above. | ||
| 3307 | || st.st_size > INT_MAX / 4 */) | ||
| 3304 | error ("Maximum buffer size exceeded"); | 3308 | error ("Maximum buffer size exceeded"); |
| 3305 | 3309 | ||
| 3306 | /* The file size returned from stat may be zero, but data | 3310 | /* The file size returned from stat may be zero, but data |