From: James Reynolds <[email protected]>

commit 1b43bad31fb0e00f45baf5b05bd21eb8d8ce7f58 upstream.

When processing a MCE_RSP_GETPORTSTATUS command, the bit index to set in
ir->txports_cabled comes from response data, and isn't validated.

As ir->txports_cabled is a u8, nothing should be done if the bit index
is greater than 7.

Cc: [email protected]
Reported-by: [email protected]
Signed-off-by: James Reynolds <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/media/rc/mceusb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1169,7 +1169,7 @@ static void mceusb_handle_command(struct
                switch (subcmd) {
                /* the one and only 5-byte return value command */
                case MCE_RSP_GETPORTSTATUS:
-                       if (buf_in[5] == 0)
+                       if (buf_in[5] == 0 && *hi < 8)
                                ir->txports_cabled |= 1 << *hi;
                        break;
 


Reply via email to