dnssec: don't qsort() empty hashlist

This commit is contained in:
Ondřej Surý
2019-11-04 16:15:22 +01:00
parent 6bf364aec8
commit 6bbb0b8e42
+4 -1
View File
@@ -787,7 +787,10 @@ hashlist_comp(const void *a, const void *b) {
static void
hashlist_sort(hashlist_t *l) {
qsort(l->hashbuf, l->entries, l->length, hashlist_comp);
INSIST(l->hashbuf != NULL || l->length == 0);
if (l->length > 0) {
qsort(l->hashbuf, l->entries, l->length, hashlist_comp);
}
}
static bool