> From: Alan Coopersmith <[email protected]> > Date: Wed, 28 Dec 2011 19:51:04 -0800 > > If it couldn't allocate memory, don't attempt to write a bunch of values > to the NULL pointer before returning it, but just pass the NULL along > right away. > > Resolves parfait warnings of the form: > > Error: Null pointer dereference (CWE 476) > Write to null pointer 'adapt' > at line 322 of src/mga_video.c in function > 'MGASetupImageVideoTexture'. > Function 'MGAAllocAdaptor' may return constant 'NULL' at line 237, > called at line 320. > Null pointer introduced at line 237 in function 'MGAAllocAdaptor'. > > repeated for every line writing to the adapt pointer in each function. > > [ This bug was found by the Parfait 0.4.2 bug checking tool. > For more information see http://labs.oracle.com/projects/parfait/ ] > > Signed-off-by: Alan Coopersmith <[email protected]> > --- > src/mga_video.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-)
Can't make things worse. Reviewed-by: Mark Kettenis <[email protected]> _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
