DragonFlyBSD Kernel Audit
DF-2016 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/raid/mfi/mfi_cam.c b/sys/dev/raid/mfi/mfi_cam.c
--- a/sys/dev/raid/mfi/mfi_cam.c
+++ b/sys/dev/raid/mfi/mfi_cam.c
@@ -336,7 +336,8 @@
 			command = csio->cdb_io.cdb_ptr[0];
 		else
 			command = csio->cdb_io.cdb_bytes[0];
-		if (command == INQUIRY) {
+		if (command == INQUIRY && csio->data_ptr != NULL &&
+		    csio->dxfer_len > 0) {
 			device = csio->data_ptr[0] & 0x1f;
 			if ((device == T_DIRECT) || (device == T_PROCESSOR))
 				csio->data_ptr[0] =