Revision: 77699
          http://sourceforge.net/p/brlcad/code/77699
Author:   brlcad
Date:     2020-11-06 17:40:36 +0000 (Fri, 06 Nov 2020)
Log Message:
-----------
make sure db_node and the path for that node are not null before adding them to 
the results table...

Modified Paths:
--------------
    brlcad/trunk/src/librt/search.c

Modified: brlcad/trunk/src/librt/search.c
===================================================================
--- brlcad/trunk/src/librt/search.c     2020-11-06 16:54:58 UTC (rev 77698)
+++ brlcad/trunk/src/librt/search.c     2020-11-06 17:40:36 UTC (rev 77699)
@@ -1748,11 +1748,13 @@
 HIDDEN int
 f_print(struct db_plan_t *UNUSED(plan), struct db_node_t *db_node, struct db_i 
*UNUSED(dbip), struct bu_ptbl *results)
 {
-    if (!results)
+    if (!results || !db_node)
        return 1;
 
     if (db_node->flags & DB_SEARCH_FLAT || db_node->flags & 
DB_SEARCH_RETURN_UNIQ_DP) {
-       bu_ptbl_ins_unique(results, (long 
*)DB_FULL_PATH_CUR_DIR(db_node->path));
+       long *dbfp = (long *)DB_FULL_PATH_CUR_DIR(db_node->path);
+       if (dbfp)
+           bu_ptbl_ins_unique(results, dbfp);
     } else {
        struct db_full_path *new_entry;
        BU_ALLOC(new_entry, struct db_full_path);

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to