Revision: 69247
          http://sourceforge.net/p/brlcad/code/69247
Author:   starseeker
Date:     2016-12-02 01:27:34 +0000 (Fri, 02 Dec 2016)
Log Message:
-----------
Check for null sketch_name

Modified Paths:
--------------
    brlcad/trunk/src/librt/db5_size.cpp

Modified: brlcad/trunk/src/librt/db5_size.cpp
===================================================================
--- brlcad/trunk/src/librt/db5_size.cpp 2016-12-02 01:26:22 UTC (rev 69246)
+++ brlcad/trunk/src/librt/db5_size.cpp 2016-12-02 01:27:34 UTC (rev 69247)
@@ -174,7 +174,7 @@
        return dpcnt;
 
     } else  if (dp->d_minor_type == DB5_MINORTYPE_BRLCAD_EXTRUDE || 
dp->d_minor_type == DB5_MINORTYPE_BRLCAD_REVOLVE) {
-       char *sketch_name;
+       char *sketch_name = NULL;
        unsigned char *ptr;
        struct directory *ndp = RT_DIR_NULL;
 
@@ -191,6 +191,7 @@
        if (dp->d_minor_type == DB5_MINORTYPE_BRLCAD_REVOLVE) {
            sketch_name = (char *)ptr + (ELEMENTS_PER_VECT*3 + 
1)*SIZEOF_NETWORK_DOUBLE;
        }
+       if (!sketch_name) return 0;
 
        if (db_lookup(dbip, sketch_name, LOOKUP_QUIET) != RT_DIR_NULL) {
            c = (struct directory **)bu_calloc(dpcnt + 1, sizeof(struct 
directory *), "children");

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to