[tracker/wip/carlosg/coverity-warnings: 12/27] libtracker-data: Add paranoia check in condition




commit 2d0c0cb01876f35297741846182a2048b76df516
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Mar 20 11:18:25 2021 +0100

    libtracker-data: Add paranoia check in condition
    
    According to Coverity, there's weird paths that may cause an ontology
    change on a new class that may still result on us trying to update the
    range of a related property.
    
    It remains to be seen whether the combination of circumstances that
    lead to this can ever happen together, but it's simple enought to add
    the paranoia check as those variables where we are composing the ALTER
    TABLE would be actually empty.
    
    CID: #1501144

 src/libtracker-data/tracker-data-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 67f97e687..8094da2ae 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2951,7 +2951,7 @@ create_decomposed_metadata_tables (TrackerDataManager  *manager,
                                        put_change = TRUE;
                                }
 
-                               if (in_change && put_change) {
+                               if (in_change && put_change && in_col_sql && sel_col_sql) {
                                        range_change_for (property, in_col_sql, sel_col_sql, field_name);
                                }
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]