summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-06 11:36:36 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-06-06 11:36:36 -0700
commit0c1477cd00313d6aa13c40550a0b413a01d188c6 (patch)
treefecfa94a4e32d8bbe5d7c62f38ccbbc030bbe4ac /src/coding.c
parentd6d100dd7c48e124ca9ce4bbb761f24b8e052493 (diff)
parent695e5b41ac15af4bcd635606db86995900617057 (diff)
downloademacs-0c1477cd00313d6aa13c40550a0b413a01d188c6.tar.gz
Merge: Cons<->int and similar integer overflow fixes.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index 6ccaf354c74..64e8e41a5a1 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1071,8 +1071,8 @@ coding_set_destination (struct coding_system *coding)
static void
coding_alloc_by_realloc (struct coding_system *coding, EMACS_INT bytes)
{
- if (coding->dst_bytes >= MOST_POSITIVE_FIXNUM - bytes)
- error ("Maximum size of buffer or string exceeded");
+ if (STRING_BYTES_MAX - coding->dst_bytes < bytes)
+ string_overflow ();
coding->destination = (unsigned char *) xrealloc (coding->destination,
coding->dst_bytes + bytes);
coding->dst_bytes += bytes;