|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/lib: Fix strcmp() and strncmp()
Jane Malalane writes ("[PATCH] xen/lib: Fix strcmp() and strncmp()"):
> The C standard requires that each character be compared as unsigned
> char. Xen's current behaviour compares as signed char, which changes
> the answer when chars with a value greater than 0x7f are used.
>
> Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Jane Malalane <jane.malalane@xxxxxxxxxx>
Thanks for this.
What are the practical effects of this bug ? AFAICT in the hypervisor
code all the call sites simply test for zero/nonzero.
Of course we should fix this because
> - if ((__res = *cs - *ct++) != 0 || !*cs++)
this substraction is UB if it overflows. So in theory the compiler
could miscompile it - although in practice I can't see how the
assumption that this doesn't overflow would "help" the compiler.
Ian.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |