[brlcad-commits] SF.net SVN: brlcad:[50083] brlcad/trunk/src/libbu/bitv.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2012-04-16 15:46:38
|
Revision: 50083 http://brlcad.svn.sourceforge.net/brlcad/?rev=50083&view=rev Author: brlcad Date: 2012-04-16 15:46:27 +0000 (Mon, 16 Apr 2012) Log Message: ----------- prevent a null dereference if we pass a null bitvector around. however, return an empty bitvector from new() so we never propagate a null. should fix coverity forward_null cid 242. Modified Paths: -------------- brlcad/trunk/src/libbu/bitv.c Modified: brlcad/trunk/src/libbu/bitv.c =================================================================== --- brlcad/trunk/src/libbu/bitv.c 2012-04-16 15:37:21 UTC (rev 50082) +++ brlcad/trunk/src/libbu/bitv.c 2012-04-16 15:46:27 UTC (rev 50083) @@ -300,6 +300,9 @@ { struct bu_bitv *bv2; + if (!bv) + return bu_bitv_new(0); + bv2 = bu_bitv_new(bv->nbits); bu_bitv_or(bv2, bv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |