public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kiraskyler at 163 dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug locale/30645] gb18030.c GB18030-2022 Remove Part of Character Set Correspondence
Date: Mon, 17 Jul 2023 08:34:37 +0000	[thread overview]
Message-ID: <bug-30645-131-IqUIMn9vPg@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30645-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30645

--- Comment #1 from kiraskyler <kiraskyler at 163 dot com> ---
files were affected
- glibc/iconvdata/gb18030.c __twobyte_to_ucs
- glibc/iconvdata/gbk.c __gbk_to_ucs

There is also a logic bug here

When idx=5dd1, it can be found in the array__ Twobyte_ To_ If the result is
found in UCS, it will not enter this if


- glibc/iconvdata/gb18030.c:24207
```
/* A two-byte character */                                    \
idx = (ch - 0x81) * 192 + (ch2 - 0x40);                       \
                                                                              \
if (idx > 0x5E7E                                                      \
  || (ch = __twobyte_to_ucs[idx],                             \
ch == 0 && *inptr != '\0'))                           \
{                                                             \
  /* Handle a few special cases.  */                          \
  if (idx == 0x5dd1)                                          \
    ch = 0x20087;                                             \
  else if (idx == 0x5dd2)                                     \
    ch = 0x20089;                                             \
  else if (idx == 0x5dd3)                                     \
    ch = 0x200cc;                                             \
  else if (idx == 0x5dec)                                     \
    ch = 0x215D7;                                             \
  else if (idx == 0x5df6)                                     \
    ch = 0x2298F;                                             \
  else if (idx == 0x5e11)                                     \
    ch = 0x241FE;                                             \
else                                                          \
{                                                             \
  /* This is an illegal character.  */                \
  STANDARD_FROM_LOOP_ERR_HANDLER (2);                 \
}
```                                                           \

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2023-07-17  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  8:23 [Bug locale/30645] New: " kiraskyler at 163 dot com
2023-07-17  8:34 ` kiraskyler at 163 dot com [this message]
2023-07-18  9:04 ` [Bug locale/30645] " lijianglin2 at huawei dot com
2023-07-19  2:43 ` kiraskyler at 163 dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30645-131-IqUIMn9vPg@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).