chiark / gitweb /
Never call qsort on potentially NULL arrays
[elogind.git] / src / libsystemd-bus / bus-match.c
index 1411167a7f4af4eb34368c36e458c639609f840f..916682aa62ba7642a1cd32ad26743ff32bd4cd12 100644 (file)
@@ -768,7 +768,7 @@ int bus_match_parse(
         }
 
         /* Order the whole thing, so that we always generate the same tree */
         }
 
         /* Order the whole thing, so that we always generate the same tree */
-        qsort(components, n_components, sizeof(struct bus_match_component), match_component_compare);
+        qsort_safe(components, n_components, sizeof(struct bus_match_component), match_component_compare);
 
         /* Check for duplicates */
         for (i = 0; i+1 < n_components; i++)
 
         /* Check for duplicates */
         for (i = 0; i+1 < n_components; i++)