Skip to contentSkip to conversation

rc: fix buffer overrun

PATCH In review Sean Young 2 participants 2 messages Aug 23, 2012 – Aug 24, 2012

Subsystems (2)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

PATCH 1/1 rc: fix buffer overrun

"[media] rc-core: move timeout and checks to lirc" introduced a buffer overrun by passing the number of bytes, rather than the number of samples, to the transmit function.

---
 drivers/media/rc/ir-lirc-codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/rc/ir-lirc-codec.c +1 -1
index 6ad4a07..569124b 100644
@@ -140,7 +140,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
 		goto out;
 	}
 
-	ret = dev->tx_ir(dev, txbuf, (u32)n);
+	ret = dev->tx_ir(dev, txbuf, count);
 	if (ret < 0)
 		goto out;
 
Signature · 1 line
1.7.11.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sean Young

"[media] rc-core: move timeout and checks to lirc" introduced a buffer overrun by passing the number of bytes, rather than the number of samples, to the transmit function.

Thanks for noticing

Quoted 20 lines

---
drivers/media/rc/ir-lirc-codec.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/rc/ir-lirc-codec.c +1 -1
index 6ad4a07..569124b 100644
@@ -140,7 +140,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
 		goto out;
 	}
 
-	ret = dev->tx_ir(dev, txbuf, (u32)n);
+	ret = dev->tx_ir(dev, txbuf, count);
 	if (ret < 0)
 		goto out;
 
Signature · 1 line
1.7.11.4
Signature · 1 line
David Härdeman