On Tue, 29 Aug 2017 17:09:45 +0200 Phil Sutter <p...@nwl.cc> wrote: > The signedness of char type is implementation dependent, and there are > architectures on which it is unsigned by default. In that case, the > check whether fgetc() returned EOF failed because the return value was > assigned an (unsigned) char variable prior to comparison with EOF (which > is defined to -1). Fix this by using int as type for 'c' variable, which > also matches the declaration of fgetc(). > > While being at it, fix the parser logic to correctly handle multiple > empty lines and consecutive whitespace and tab characters to further > improve the parser's robustness. Note that this will still detect double > separator characters, so doesn't soften up the parser too much. > > Fixes: 3da3ebfca85b8 ("bpf: Make bytecode-file reading a little more robust") > Cc: Daniel Borkmann <dan...@iogearbox.net> > Signed-off-by: Phil Sutter <p...@nwl.cc>
Looks fine applied. Although I think only Android is using unsigned for char type at this point.