On Fri, Apr 25, 2014 at 10:17 AM, Denis Oliver Kropp <d...@directfb.org> wrote: > On 03/27/14 00:41, Frédéric Basse wrote: >> Hi, >> >> I've found some bugs in directfb source tree: >> >> * CWE-192: Integer Coercion Error >> 'rect->w' is not explicitly unsigned. >> => >> http://git.directfb.org/?p=core/DirectFB.git;a=blob;f=proxy/dispatcher/idirectfbsurface_dispatcher.c;h=6e99cbba8a8430869b318936ed63a80f44b83201;hb=HEAD#l1735 >> => >> http://git.directfb.org/?p=core/DirectFB.git;a=blob;f=proxy/dispatcher/idirectfbsurface_dispatcher.c;h=6e99cbba8a8430869b318936ed63a80f44b83201;hb=HEAD#l1759 > > Thanks, why should it be unsigned? > > The rectangle coordinates can also be negative. From DFBRectangle definition, rect->w is width. This test checks if rect->w is larger than 2048 in order to choose between stack allocation and heap allocation. In this situation, a negative number is not valid. The absolute value of rect->w might be a solution.
> > -- > Denis Oliver Kropp > CEO > DirectFB integrated media GmbH > _______________________________________________ > directfb-dev mailing list > directfb-dev@directfb.org > http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev