diff options
author | Miles Bader <miles@gnu.org> | 2007-12-29 02:39:17 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-12-29 02:39:17 +0000 |
commit | a0c92ed92d3d62d4926dafb1d595d87843df4688 (patch) | |
tree | 78f12dd6f97a0f96b846fbf08e3f8ce39a701f8e /src/fileio.c | |
parent | 9aeb99f00a02c695b14f2ee349141eb9641ca6da (diff) | |
parent | 870356897e927f380841268667a92b40fb9e6782 (diff) | |
download | emacs-a0c92ed92d3d62d4926dafb1d595d87843df4688.tar.gz emacs-a0c92ed92d3d62d4926dafb1d595d87843df4688.tar.bz2 emacs-a0c92ed92d3d62d4926dafb1d595d87843df4688.zip |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-306
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c index 51a40e66db9..4dfb0d24796 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -21,6 +21,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> +#include <limits.h> #ifdef HAVE_FCNTL_H #include <fcntl.h> @@ -3882,7 +3883,7 @@ variable `last-coding-system-used' to the coding system actually used. */) overflow. The calculations below double the file size twice, so check that it can be multiplied by 4 safely. */ if (XINT (end) != st.st_size - || ((int) st.st_size * 4) / 4 != st.st_size) + || st.st_size > INT_MAX / 4) error ("Maximum buffer size exceeded"); /* The file size returned from stat may be zero, but data |