Skip to contentSkip to conversation

ir-ctl: uninitialised memory used

PATCH New Sean Young 1 participant 1 message Dec 2, 2016 Media (V4L/DVB)

lore
Share & tools
lore

Sean Young

author
#0 lore raw

PATCH 1/6 ir-ctl: uninitialised memory used

We might end up with a corrupt rc6.

---
 utils/ir-ctl/ir-encode.c | 1 +
 1 file changed, 1 insertion(+)
utils/ir-ctl/ir-encode.c +1 -0
index a0d2f4c..1bf0ac6 100644
@@ -310,6 +310,7 @@ static int rc6_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
 
 	buf[n++] = NS_TO_US(rc6_unit * 6);
 	buf[n++] = NS_TO_US(rc6_unit * 2);
+	buf[n] = 0;
 
 	switch (proto) {
 	default:
Signature · 1 line
2.9.3