lkml.org 
[lkml]   [2013]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] dvb: fix potential format string leak
From
Date
On Mon, 2013-09-16 at 16:37 -0700, Kees Cook wrote:
> Make sure that a format string cannot accidentally leak into the printk
> buffer.
[]
> diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c
[]
> @@ -649,7 +649,7 @@ static int dib9000_risc_debug_buf(struct dib9000_state *state, u16 * data, u8 si
> b[2 * (size - 2) - 1] = '\0'; /* Bullet proof the buffer */
> if (*b == '~') {
> b++;
> - dprintk(b);
> + dprintk("%s", b);
> } else
> dprintk("RISC%d: %d.%04d %s", state->fe_id, ts / 10000, ts % 10000, *b ? b : "<emtpy>");
> return 1;

This looks odd.

Perhaps this should be:

if (*b == '~')
b++;
dprintk("etc...);

It'd be nice to fix the <empty> typo too.




\
 
 \ /
  Last update: 2013-09-17 02:01    [W:0.032 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site