This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix buffer overrun in EUC-KR conversion module (bug 24973)



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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]