[Openvas-commits] r5629 - in trunk/openvas-libraries: . omp

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 19 23:58:26 CEST 2009


Author: mattm
Date: 2009-10-19 23:58:26 +0200 (Mon, 19 Oct 2009)
New Revision: 5629

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/omp/xml.c
Log:
	* omp/xml.c (compare_entities): Continue to the rest of the comparisons
	when the attributes are both NULL, instead of claiming equality.

Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2009-10-19 19:50:22 UTC (rev 5628)
+++ trunk/openvas-libraries/ChangeLog	2009-10-19 21:58:26 UTC (rev 5629)
@@ -1,3 +1,8 @@
+2009-10-19  Matthew Mundell <matthew.mundell at intevation.de>
+
+	* omp/xml.c (compare_entities): Continue to the rest of the comparisons
+	when the attributes are both NULL, instead of claiming equality.
+
 2009-10-19  Michael Wiegand <michael.wiegand at intevation.de>
 
 	Post-release version bump.

Modified: trunk/openvas-libraries/omp/xml.c
===================================================================
--- trunk/openvas-libraries/omp/xml.c	2009-10-19 19:50:22 UTC (rev 5628)
+++ trunk/openvas-libraries/omp/xml.c	2009-10-19 21:58:26 UTC (rev 5629)
@@ -698,8 +698,6 @@
 {
   if (entity1 == NULL) return entity2 == NULL ? 0 : 1;
   if (entity2 == NULL) return 1;
-  if (entity1->attributes == NULL) return entity2->attributes == NULL ? 0 : 1;
-  if (entity2->attributes == NULL) return 1;
 
   if (strcmp (entity1->name, entity2->name))
     {
@@ -713,13 +711,21 @@
       return 1;
     }
 
-  if (g_hash_table_find (entity1->attributes,
-                         compare_find_attribute,
-                         (gpointer) entity2->attributes))
+  if (entity1->attributes == NULL)
     {
-      g_message ("  compare failed attributes\n");
-      return 1;
+      if (entity2->attributes) return 1;
     }
+  else
+    {
+      if (entity2->attributes == NULL) return 1;
+      if (g_hash_table_find (entity1->attributes,
+                             compare_find_attribute,
+                             (gpointer) entity2->attributes))
+        {
+          g_message ("  compare failed attributes\n");
+          return 1;
+        }
+    }
 
   // FIX entities can be in any order
   GSList* list1 = entity1->entities;



More information about the Openvas-commits mailing list