diff options
| author | Paul Eggert | 2015-01-21 00:29:02 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-01-21 00:29:32 -0800 |
| commit | 88ba49fe356ecbb57f604158c432f1044d50b0bb (patch) | |
| tree | 0140027f2210cbeb8d18de370e2165c71c755c31 /src/coding.c | |
| parent | 3ea1b31f46f21ecfb089628e63187970fdb58d5a (diff) | |
| download | emacs-88ba49fe356ecbb57f604158c432f1044d50b0bb.tar.gz emacs-88ba49fe356ecbb57f604158c432f1044d50b0bb.zip | |
Fix coding.c subscript error
* coding.c (CODING_ISO_INVOKED_CHARSET):
Avoid undefined behavior if CODING_ISO_INVOCATION returns negative.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index 77583d0d950..8dc39e74422 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -395,7 +395,8 @@ static Lisp_Object Vbig5_coding_system; | |||
| 395 | #define CODING_ISO_BOL(coding) \ | 395 | #define CODING_ISO_BOL(coding) \ |
| 396 | ((coding)->spec.iso_2022.bol) | 396 | ((coding)->spec.iso_2022.bol) |
| 397 | #define CODING_ISO_INVOKED_CHARSET(coding, plane) \ | 397 | #define CODING_ISO_INVOKED_CHARSET(coding, plane) \ |
| 398 | CODING_ISO_DESIGNATION ((coding), CODING_ISO_INVOCATION ((coding), (plane))) | 398 | (CODING_ISO_INVOCATION (coding, plane) < 0 ? -1 \ |
| 399 | : CODING_ISO_DESIGNATION (coding, CODING_ISO_INVOCATION (coding, plane))) | ||
| 399 | #define CODING_ISO_CMP_STATUS(coding) \ | 400 | #define CODING_ISO_CMP_STATUS(coding) \ |
| 400 | (&(coding)->spec.iso_2022.cmp_status) | 401 | (&(coding)->spec.iso_2022.cmp_status) |
| 401 | #define CODING_ISO_EXTSEGMENT_LEN(coding) \ | 402 | #define CODING_ISO_EXTSEGMENT_LEN(coding) \ |