[PATCH] dvb: dst: Fix possible buffer overflow
authorManu Abraham <manu@linuxtv.org>
Wed, 9 Nov 2005 05:35:24 +0000 (21:35 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:56:02 +0000 (07:56 -0800)
Fixes a possible buffer overflow due to reading more than 8 bytes into an 8
byte long array

Thanks to Perceval Anichini <perceval.anichini@streamvision.fr> for pointing
out the bug.

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/dvb/bt8xx/dst_ca.c

index 16645e0..38c7289 100644 (file)
@@ -196,7 +196,7 @@ static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_s
        int i;
        static u8 slot_command[8] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff};
 
-       u8 *slot_info = state->rxbuffer;
+       u8 *slot_info = state->messages;
 
        put_checksum(&slot_command[0], 7);
        if ((dst_put_ci(state, slot_command, sizeof (slot_command), slot_info, GET_REPLY)) < 0) {