Re: [PATCH] xen/lib: Fix strcmp() and strncmp()

2021-07-30 Thread Ian Jackson
Andrew Cooper writes ("Re: [PATCH] xen/lib: Fix strcmp() and strncmp()"): > On 27/07/2021 19:47, Jane Malalane wrote: > > - register signed char __res; > > + unsigned char *csu = (unsigned char *)cs; > > + unsigned char *ctu = (unsigned char *)ct; > >

Re: [PATCH] xen/lib: Fix strcmp() and strncmp()

2021-07-30 Thread Andrew Cooper
On 27/07/2021 19:47, Jane Malalane wrote: > diff --git a/xen/lib/strcmp.c b/xen/lib/strcmp.c > index 465f1c4191..f85c1e8741 100644 > --- a/xen/lib/strcmp.c > +++ b/xen/lib/strcmp.c > @@ -11,14 +11,16 @@ > */ > int (strcmp)(const char *cs, const char *ct) > { > - register signed char __res;

Re: [PATCH] xen/lib: Fix strcmp() and strncmp()

2021-07-30 Thread Ian Jackson
Jane Malalane writes ("Re: [PATCH] xen/lib: Fix strcmp() and strncmp()"): > On 28/07/2021 11:42, Ian Jackson wrote: > What are the practical effects of this bug ? AFAICT in the hypervisor > code all the call sites simply test for zero/nonzero. ... > This fix was

Re: [PATCH] xen/lib: Fix strcmp() and strncmp()

2021-07-29 Thread Jane Malalane
On 28/07/2021 11:42, Ian Jackson wrote: [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments unless you have verified the sender and know the content is safe. Jane Malalane writes ("[PATCH] xen/lib: Fix strcmp() and strncmp()"): The C standard requires

Re: [PATCH] xen/lib: Fix strcmp() and strncmp()

2021-07-28 Thread Ian Jackson
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

[PATCH] xen/lib: Fix strcmp() and strncmp()

2021-07-27 Thread Jane Malalane
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 Signed-off-by: Jane Malalane --- CC: Andrew Cooper CC: George Dunla