Re: [PATCH] lib: fix buggy strcmp and strncmp

2022-10-27 Thread Tom Rini
On Wed, Oct 05, 2022 at 11:09:25AM +0200, Rasmus Villemoes wrote: > There are two problems with both strcmp and strncmp: > > (1) The C standard is clear that the contents should be compared as > "unsigned char": > > The sign of a nonzero value returned by the comparison functions > memcmp,

Re: [PATCH] lib: fix buggy strcmp and strncmp

2022-10-25 Thread Rasmus Villemoes
On 05/10/2022 11.09, Rasmus Villemoes wrote: > There are two problems with both strcmp and strncmp: > Hi Tom Could you consider applying this now to give it ample time to soak before release? I'm pretty confident it's correct. Rasmus

[PATCH] lib: fix buggy strcmp and strncmp

2022-10-05 Thread Rasmus Villemoes
There are two problems with both strcmp and strncmp: (1) The C standard is clear that the contents should be compared as "unsigned char": The sign of a nonzero value returned by the comparison functions memcmp, strcmp, and strncmp is determined by the sign of the difference between the