Skip to contentSkip to conversation

ttusb-dec: buffer overflow in ioctl

PATCH New Dan Carpenter 1 participant 1 message Sep 5, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ttusb-dec: buffer overflow in ioctl

We need to add a limit check here so we don't overflow the buffer.

drivers/media/usb/ttusb-dec/ttusbdecfe.c +3 -0
index 5c45c9d..9c29552 100644
@@ -156,6 +156,9 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00 };
 
+	if (cmd->msg_len > sizeof(b) - 4)
+		return -EINVAL;
+
 	memcpy(&b[4], cmd->msg, cmd->msg_len);
 
 	state->config->send_command(fe, 0x72,