Revision: 55521
http://sourceforge.net/p/brlcad/code/55521
Author: brlcad
Date: 2013-05-21 20:01:10 +0000 (Tue, 21 May 2013)
Log Message:
-----------
validate our input parameters before assuming they're non-null
Modified Paths:
--------------
brlcad/trunk/src/librt/db_anim.c
Modified: brlcad/trunk/src/librt/db_anim.c
===================================================================
--- brlcad/trunk/src/librt/db_anim.c 2013-05-21 13:52:43 UTC (rev 55520)
+++ brlcad/trunk/src/librt/db_anim.c 2013-05-21 20:01:10 UTC (rev 55521)
@@ -50,6 +50,10 @@
if (root) {
if (RT_G_DEBUG&DEBUG_ANIM)
bu_log("db_add_anim(x%x) root\n", anp);
+
+ if (!dbip)
+ bu_bomb("Unexpected NULL dbip encountered in db_add_anim\n");
+
headp = &(dbip->dbi_anroot);
} else {
dp = DB_FULL_PATH_CUR_DIR(&anp->an_path);
@@ -217,12 +221,15 @@
}
void
-db_free_anim(register struct db_i *dbip)
+db_free_anim(struct db_i *dbip)
{
register struct animate *anp;
register struct directory *dp;
register int i;
+ if (!dbip)
+ return;
+
/* Rooted animations */
for (anp = dbip->dbi_anroot; anp != ANIM_NULL;) {
register struct animate *nextanp;
@@ -259,6 +266,9 @@
struct animate *anp;
int i;
+ if (!dbip)
+ return NULL;
+
if (argc < 4) {
bu_log("db_parse_1anim: not enough arguments\n");
return (struct animate *)NULL;
@@ -440,6 +450,9 @@
char *thepath;
int i;
+ if (!fop)
+ return;
+
RT_CK_ANIMATE(anp);
thepath = db_path_to_string(&(anp->an_path));
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits