aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-09-27 09:31:12 -0700
committerPaul Eggert2011-09-27 09:31:12 -0700
commit7b09a37a895ab2d428d1ab0786aa262ef82efba2 (patch)
tree6c5c801a75e935804a4a25d524d83124d4de029b
parenteee134655504adba0a868dc064078e814d6aa33a (diff)
downloademacs-7b09a37a895ab2d428d1ab0786aa262ef82efba2.tar.gz
emacs-7b09a37a895ab2d428d1ab0786aa262ef82efba2.zip
* coding.c (Ffind_operation_coding_system): Avoid subscript error.
-rw-r--r--src/ChangeLog1
-rw-r--r--src/coding.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7b09cb744a3..4f1edc95668 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -172,6 +172,7 @@
172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts. 172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
173 (consume_chars): Rewrite to avoid calculating an address outside buffer. 173 (consume_chars): Rewrite to avoid calculating an address outside buffer.
174 (Ffind_operation_coding_system): NATNUMP can eval its arg twice. 174 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
175 Don't access memory outside of the args array.
175 (Fdefine_coding_system_internal): Check for charset-id overflow. 176 (Fdefine_coding_system_internal): Check for charset-id overflow.
176 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned 177 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
177 result of ENCODE_CHAR. 178 result of ENCODE_CHAR.
diff --git a/src/coding.c b/src/coding.c
index 25ac0e9764c..e8765aea96d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -9291,7 +9291,7 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
9291 if (!SYMBOLP (operation) 9291 if (!SYMBOLP (operation)
9292 || (target_idx = Fget (operation, Qtarget_idx), !NATNUMP (target_idx))) 9292 || (target_idx = Fget (operation, Qtarget_idx), !NATNUMP (target_idx)))
9293 error ("Invalid first argument"); 9293 error ("Invalid first argument");
9294 if (nargs < 1 + XFASTINT (target_idx)) 9294 if (nargs <= 1 + XFASTINT (target_idx))
9295 error ("Too few arguments for operation `%s'", 9295 error ("Too few arguments for operation `%s'",
9296 SDATA (SYMBOL_NAME (operation))); 9296 SDATA (SYMBOL_NAME (operation)));
9297 target = args[XFASTINT (target_idx) + 1]; 9297 target = args[XFASTINT (target_idx) + 1];