lkml.org 
[lkml]   [2019]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] dio: Fix buffer overflow in case of unknown board
On Mon, Jan 21, 2019 at 10:24 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> With gcc 8.2.0:
>
> drivers/dio/dio.c: In function ‘dio_init’:
> drivers/dio/dio.c:240:17: warning: ‘strcpy’ writing 69 or more bytes into a region of size 64 overflows the destination [-Wstringop-overflow=]
> strcpy(dev->name,dio_getname(dev->id));
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Indeed, if an unknown board is present, the target buffer will overflow.
> Shorten the unknown board name string to fix this, and declare it as an
> array while at it.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Thanks, applied and queued for v5.1.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

\
 
 \ /
  Last update: 2019-01-21 10:44    [W:0.027 / U:47.340 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site