Re: strncat() misuse (was: Re: dm_attr_{name,uuid}_show buffer overflow? (was: Re: linux-next: Tree for January 5))

From: Laurent Pinchart
Date: Wed Jan 07 2009 - 09:39:52 EST


Hi Geert,

On Monday 05 January 2009, Geert Uytterhoeven wrote:
>
> A quick `git grep strncat' shows a few more misusers of strncat() that may
>
> cause buffer overflows and should be converted to strlcat():
> | drivers/media/video/uvc/uvc_driver.c:
> | strncat(format->name, buffer[8] & (1 << 7) ? " 60Hz" : " 50Hz",

Thanks for the report. As both the source length is fixed and the destination
buffer length known, I'll just replace strncat with strcat.

Best regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/