[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH] block/parallels.c: avoid integer o
Re: [Qemu-block] [Qemu-devel] [PATCH] block/parallels.c: avoid integer overflow in allocate_clusters()
Fri, 31 Mar 2017 17:18:39 +0100
On Fri, Mar 31, 2017 at 10:40:33AM -0300, Eduardo Habkost wrote:
> On Fri, Mar 31, 2017 at 10:27:44AM -0300, Philippe Mathieu-Daudé wrote:
> > Hi,
> > Eduardo you seem skilled regarding Coccinelle scripts, is it possible to
> > write one to find those overflows?
> Probably not. AFAIK, Coccinelle rules are based on local code
> syntax only. This means it doesn't know the data type of
> expressions like (s->tracks).
I'm surprised by that statement. Coccinelle isn't a text matcher, it's
a proper C compiler frontend that parses the all code in the compilation
unit. Therefore it must have the type information even for s->tracks.
Disclaimer: This should in no way be considered a volunteer offer to
write cocci scripts now or at any time in the future :). I'm not fluent
in the semantic patch syntax.
Description: PGP signature