This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix buffer overrun in EUC-KR conversion module (bug 24973)
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 9 Sep 2019 14:16:48 -0300
- Subject: Re: [PATCH] Fix buffer overrun in EUC-KR conversion module (bug 24973)
- References: <mvmftl5sbqj.fsf@suse.de>
On 09/09/2019 12:58, Andreas Schwab wrote:
> diff --git a/iconvdata/euc-kr.c b/iconvdata/euc-kr.c
> index 379414c426..167a554719 100644
> --- a/iconvdata/euc-kr.c
> +++ b/iconvdata/euc-kr.c
> @@ -83,7 +83,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
> /* 0xfe(->0x7e : row 94) and 0xc9(->0x59 : row 41) are \
> user-defined areas. */ \
> else if (__builtin_expect (ch == 0xa0, 0) \
> - || __builtin_expect (ch > 0xfe, 0) \
> + || __builtin_expect (ch >= 0xfe, 0) \
> || __builtin_expect (ch == 0xc9, 0)) \
> { \
> /* This is illegal. */ \
>
We should aim to use __glibc_{un}likely for new code.