aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorPaul Eggert2011-06-15 12:57:25 -0700
committerPaul Eggert2011-06-15 12:57:25 -0700
commita7af7fdede602a111401c2352e81311a9dc38b99 (patch)
treedaebcb8a73345231337d0a461c01ae7804b2b646 /src/coding.c
parent8c9b210626493dd93f236d7fb312c4f6dba62892 (diff)
parentb1c46f026de9d185ba86ffb1b23c50f2bd095ccf (diff)
downloademacs-a7af7fdede602a111401c2352e81311a9dc38b99.tar.gz
emacs-a7af7fdede602a111401c2352e81311a9dc38b99.zip
Integer overflow and signedness fixes (Bug#8873).
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c
index 64e8e41a5a1..04985ab3c74 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1071,7 +1071,7 @@ coding_set_destination (struct coding_system *coding)
1071static void 1071static void
1072coding_alloc_by_realloc (struct coding_system *coding, EMACS_INT bytes) 1072coding_alloc_by_realloc (struct coding_system *coding, EMACS_INT bytes)
1073{ 1073{
1074 if (STRING_BYTES_MAX - coding->dst_bytes < bytes) 1074 if (STRING_BYTES_BOUND - coding->dst_bytes < bytes)
1075 string_overflow (); 1075 string_overflow ();
1076 coding->destination = (unsigned char *) xrealloc (coding->destination, 1076 coding->destination = (unsigned char *) xrealloc (coding->destination,
1077 coding->dst_bytes + bytes); 1077 coding->dst_bytes + bytes);
@@ -9278,7 +9278,7 @@ function to call for FILENAME, that function should examine the
9278contents of BUFFER instead of reading the file. 9278contents of BUFFER instead of reading the file.
9279 9279
9280usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) 9280usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
9281 (size_t nargs, Lisp_Object *args) 9281 (ptrdiff_t nargs, Lisp_Object *args)
9282{ 9282{
9283 Lisp_Object operation, target_idx, target, val; 9283 Lisp_Object operation, target_idx, target, val;
9284 register Lisp_Object chain; 9284 register Lisp_Object chain;
@@ -9355,9 +9355,9 @@ If multiple coding systems belong to the same category,
9355all but the first one are ignored. 9355all but the first one are ignored.
9356 9356
9357usage: (set-coding-system-priority &rest coding-systems) */) 9357usage: (set-coding-system-priority &rest coding-systems) */)
9358 (size_t nargs, Lisp_Object *args) 9358 (ptrdiff_t nargs, Lisp_Object *args)
9359{ 9359{
9360 size_t i, j; 9360 ptrdiff_t i, j;
9361 int changed[coding_category_max]; 9361 int changed[coding_category_max];
9362 enum coding_category priorities[coding_category_max]; 9362 enum coding_category priorities[coding_category_max];
9363 9363
@@ -9461,7 +9461,7 @@ DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
9461 Sdefine_coding_system_internal, coding_arg_max, MANY, 0, 9461 Sdefine_coding_system_internal, coding_arg_max, MANY, 0,
9462 doc: /* For internal use only. 9462 doc: /* For internal use only.
9463usage: (define-coding-system-internal ...) */) 9463usage: (define-coding-system-internal ...) */)
9464 (size_t nargs, Lisp_Object *args) 9464 (ptrdiff_t nargs, Lisp_Object *args)
9465{ 9465{
9466 Lisp_Object name; 9466 Lisp_Object name;
9467 Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */ 9467 Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */