Commit 38cf95df authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(encode_coding_iso2022): Don't skip a code following some invalid code.

parent 490fe8b0
...@@ -1868,8 +1868,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) ...@@ -1868,8 +1868,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{ {
/* invalid sequence */ /* invalid sequence */
*dst++ = c1; *dst++ = c1;
*dst++ = c2; src--;
coding->consumed_char += 2; coding->consumed_char++;
} }
else else
ENCODE_ISO_CHARACTER (c1, c2, /* dummy */ c3); ENCODE_ISO_CHARACTER (c1, c2, /* dummy */ c3);
...@@ -1881,9 +1881,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) ...@@ -1881,9 +1881,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{ {
/* invalid sequence */ /* invalid sequence */
*dst++ = c1; *dst++ = c1;
*dst++ = c2; src -= 2;
*dst++ = c3; coding->consumed_char++;
coding->consumed_char += 3;
} }
else if (c1 < LEADING_CODE_PRIVATE_11) else if (c1 < LEADING_CODE_PRIVATE_11)
ENCODE_ISO_CHARACTER (c1, c2, c3); ENCODE_ISO_CHARACTER (c1, c2, c3);
...@@ -1897,10 +1896,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) ...@@ -1897,10 +1896,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{ {
/* invalid sequence */ /* invalid sequence */
*dst++ = c1; *dst++ = c1;
*dst++ = c2; src -= 3;
*dst++ = c3; coding->consumed_char++;
*dst++ = c4;
coding->consumed_char += 4;
} }
else else
ENCODE_ISO_CHARACTER (c2, c3, c4); ENCODE_ISO_CHARACTER (c2, c3, c4);
...@@ -1912,8 +1909,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) ...@@ -1912,8 +1909,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{ {
/* invalid sequence */ /* invalid sequence */
*dst++ = c1; *dst++ = c1;
*dst++ = c2; src--;
coding->consumed_char += 2; coding->consumed_char++;
} }
else if (c2 == 0xFF) else if (c2 == 0xFF)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment