summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina <fgallina@gnu.org>2015-01-28 01:03:46 -0300
committerFabián Ezequiel Gallina <fgallina@gnu.org>2015-01-28 01:03:46 -0300
commit33ab7ee0edcb3608e4a3d5deebc2b72c180dbfe4 (patch)
tree946ccc8bdc1f41a2c4066e6fcef4bfd04a9d693a /src
parent85ca47671ccbffe87d6ccad17039b49d6b676d61 (diff)
parent8ee825c35b62768e28fe825163dea90d3ab46022 (diff)
downloademacs-33ab7ee0edcb3608e4a3d5deebc2b72c180dbfe4.tar.gz
Merge from origin/emacs-24
8ee825c doc/emacs/programs.texi (Custom C Indent): Fix a typo. (Bug#19647) 88ba49f Fix coding.c subscript error 3ea1b31 Prevent artist-mode from creating runaway timers (Bug#6130).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/coding.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5ced4734bc9..d46e34c8525 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix coding.c subscript error
+ * coding.c (CODING_ISO_INVOKED_CHARSET):
+ Avoid undefined behavior if CODING_ISO_INVOCATION returns negative.
+
2015-01-17 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (produce_image_glyph): Fix display of images in R2L
diff --git a/src/coding.c b/src/coding.c
index 54811588c6a..a7128ee3e73 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -350,7 +350,8 @@ static Lisp_Object Vbig5_coding_system;
#define CODING_ISO_BOL(coding) \
((coding)->spec.iso_2022.bol)
#define CODING_ISO_INVOKED_CHARSET(coding, plane) \
- CODING_ISO_DESIGNATION ((coding), CODING_ISO_INVOCATION ((coding), (plane)))
+ (CODING_ISO_INVOCATION (coding, plane) < 0 ? -1 \
+ : CODING_ISO_DESIGNATION (coding, CODING_ISO_INVOCATION (coding, plane)))
#define CODING_ISO_CMP_STATUS(coding) \
(&(coding)->spec.iso_2022.cmp_status)
#define CODING_ISO_EXTSEGMENT_LEN(coding) \