[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160309124940.7d870c59a7a7117c6c6d7937@linux-foundation.org>
Date: Wed, 9 Mar 2016 12:49:40 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Kees Cook <keescook@...omium.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC 0/7] eliminate snprintf with overlapping src and dst
On Tue, 8 Mar 2016 21:40:47 +0100 Rasmus Villemoes <linux@...musvillemoes.dk> wrote:
> Doing snprintf(buf, len, "%s...", buf, ...) for appending to a buffer
> currently works, but it is somewhat fragile, and any other overlap
> between source and destination buffers would be a definite bug. This
> is an attempt at eliminating the relatively few occurences of this
> pattern in the kernel.
I dunno,
snprintf(analog->name, sizeof(analog->name), "Analog %d-axis %d-button",
is pretty damn convenient. Can we instead state that "sprintf shall
support this"? Maybe add a little __init testcase to vsprintf.c to
check that it continues to work OK.
Powered by blists - more mailing lists