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/nss-myhostname/netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nss-myhostname') diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c index b1ef912c8a..47a41f55e6 100644 --- a/src/nss-myhostname/netlink.c +++ b/src/nss-myhostname/netlink.c @@ -197,7 +197,8 @@ finish: return r; } - qsort(list, n_list, sizeof(struct address), address_compare); + if (n_list) + qsort(list, n_list, sizeof(struct address), address_compare); *_list = list; *_n_list = n_list; -- cgit v1.2.3-54-g00ecf