Subject: Re: [iproute PATCH] lib/bpf: Fix bytecode-file parsing

From: Stephen Hemminger <[email-masked]>
Date: Mon, 4 Sep 2017 12:09:06 -0700

On Tue, 29 Aug 2017 17:09:45 +0200
Phil Sutter <[email-masked]> 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 <[email-masked]>
> Signed-off-by: Phil Sutter <[email-masked]>

Looks fine applied.

Although I think only Android is using unsigned for char type at this point.