From 7ff7394d9e4e9189c30fd018235e6b1728c6f2d0 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 11 Oct 2013 19:33:13 -0400 Subject: Never call qsort on potentially NULL arrays This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero. --- src/journal/catalog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/journal/catalog.c') diff --git a/src/journal/catalog.c b/src/journal/catalog.c index 7738d243a5..90ca008064 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -399,7 +399,7 @@ int catalog_update(const char* database, const char* root, const char* const* di } assert(n == hashmap_size(h)); - qsort(items, n, sizeof(CatalogItem), catalog_compare_func); + qsort_safe(items, n, sizeof(CatalogItem), catalog_compare_func); r = write_catalog(database, h, sb, items, n); if (r < 0) -- cgit v1.2.3-54-g00ecf