> > > The _strip() function passes a char directly to isspace(), which is
> > > undefined behavior. The ctype functions require an int argument that is
> > > either an unsigned char value or EOF, but char is signed by default on
> > > x86 and ARM, so any byte >= 0x80 in the input is promoted to a negative
> > > int and indexes the ctype table out of bounds.
> > >
> > > Such bytes are reachable from a user-provided config file containing
> > > UTF-8 or other non-ASCII content.
> > >
> > > Cast the argument to unsigned char, as is already done in
> > > app/test-bbdev/test_bbdev_vector.c and elsewhere.
> > >
> > > Fixes: eaafbad419bf ("cfgfile: library to interpret config files")
> > > Cc: [email protected]
> > >
> > > Signed-off-by: Wei Chen <[email protected]>
> > Acked-by: Bruce Richardson <[email protected]>
> Acked-by: Cristian Dumitrescu <[email protected]>

Applied, thanks.



Reply via email to