DragonFlyBSD Kernel Audit
DF-1493 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/disk/ccd/ccd.c
+++ b/sys/dev/disk/ccd/ccd.c
@@ -1316,6 +1316,11 @@
 		if ((error = ccdlock(cs)) != 0)
 			return (error);
 
+		if (ccio->ccio_ndisks == 0) {
+			ccdunlock(cs);
+			return (EINVAL);
+		}
+
 		if (ccio->ccio_ndisks > CCD_MAXNDISKS) {
 			ccdunlock(cs);
 			return (EINVAL);