⬢ DragonFlyBSD Kernel Audit
DF-5697 / fix.diff
← back to finding ↓ download raw
--- a/sys/libkern/qsort.c
+++ b/sys/libkern/qsort.c
@@ -108,6 +108,8 @@
 	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
 	int d, r, swaptype, swap_cnt;
 
+	if (es == 0)	/* degenerate element size: nothing to do */
+		return;
 loop:	SWAPINIT(a, es);
 	swap_cnt = 0;
 	if (n < 7) {