Re: [PATCH] isalpha.3: behavior is undefined if c is out-of-range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 5, 2023 at 4:15 PM Alejandro Colomar <alx@xxxxxxxxxx> wrote:
>
> Hi,
>
> On 6/5/23 14:34, Yedidyah Bar David wrote:
> > Hi,
> >
> > On Mon, Jun 5, 2023 at 2:35 PM Alejandro Colomar <alx.manpages@xxxxxxxxx> wrote:
> >>
> >> Hi Yedidyah,
> >>
> >> On 6/5/23 13:17, Yedidyah Bar David wrote:
> >>> Clarify that the behavior of these functions is undefined if c is
> >>> neither in the unsigned char range nor EOF.
> >>>
> >>> I copied the added text from toupper.3.
> >>>
> >>> In practice, calling them on out-of-range values - tested with recent
> >>> glibc/gcc - is simply reading from random process memory - meaning, you
> >>> either get some garbage, if the memory was readable, or a segmentation
> >>> fault. See also:
> >>>
> >>> https://stackoverflow.com/questions/65514890/glibcs-isalpha-function-and-the-en-us-utf-8-locale
> >>>
> >>> Signed-off-by: Yedidyah Bar David <didi@xxxxxxxxxx>
> >>
> >> This is already covered by the NOTES section, isn't it?
> >
> > It's _mentioned_ there, correct - but not sure it's covered.
>
> You're right.  That's why I've sent the patch mentioning UB.
> What do you think about that one?  (I now see that you like it).

Yes, I like it. Thanks!

Thanks also for the explanations/example.

Best regards,
-- 
Didi





[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux