lkml.org 
[lkml]   [2007]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix writing to unintended memory in pkt_generic_packet(); drivers/block/pktcdvd.c
On Tue, Nov 06, 2007 at 11:43:12PM +0100, Roel Kluin wrote:
> CDROM_PACKET_SIZE is added as an offset to the pointer to unsigned char cmd[16].
> The adjusted pointer is then used as a destination address in a call to
> memset(). However, when CDROM_PACKET_SIZE is added to the pointer, it is
> automatically scaled by the size of cmd, which is 16. This results in the call
> to memset() writing to unintended memory.

What are you talking about? rq->cmd is an array, not a pointer to array.
When it occurs as an argument of +, it decays to pointer to array element.
Please, learn C.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-06 23:53    [W:0.045 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site