aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorPip Cet2026-03-07 11:30:55 +0000
committerPip Cet2026-03-07 11:36:58 +0000
commitf254b2cc19004233d193817d7a353e0ad9e59590 (patch)
treee579ace8af105d31ac847ef094e39bd60bc997ec /src/coding.c
parentb9b59447a154ba6796b18cfb3821cb748b5dfdfb (diff)
downloademacs-f254b2cc19004233d193817d7a353e0ad9e59590.tar.gz
emacs-f254b2cc19004233d193817d7a353e0ad9e59590.zip
Fix infloop when decoding incomplete embedded UTF-8 input
* src/coding.c (decode_coding_iso_2022): Record conversion result for incomplete data.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c
index bec6e5669b9..d5833a98c23 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -3524,7 +3524,11 @@ decode_coding_iso_2022 (struct coding_system *coding)
3524 if (c1 == ISO_CODE_ESC) 3524 if (c1 == ISO_CODE_ESC)
3525 { 3525 {
3526 if (src + 1 >= src_end) 3526 if (src + 1 >= src_end)
3527 goto no_more_source; 3527 {
3528 record_conversion_result
3529 (coding, CODING_RESULT_INSUFFICIENT_SRC);
3530 goto no_more_source;
3531 }
3528 *charbuf++ = ISO_CODE_ESC; 3532 *charbuf++ = ISO_CODE_ESC;
3529 char_offset++; 3533 char_offset++;
3530 if (src[0] == '%' && src[1] == '@') 3534 if (src[0] == '%' && src[1] == '@')