Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 22 Jul 2019 21:35:27 -0700
From: Andrew Morton <>
To: Joe Perches <>
Cc: Linus Torvalds <>,, Jonathan Corbet <>, Stephen
 Kitt <>, Kees Cook <>, Nitin Gote
 <>,,, Rasmus Villemoes
Subject: Re: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms

On Mon, 22 Jul 2019 17:38:15 -0700 Joe Perches <> wrote:

> Several uses of strlcpy and strscpy have had defects because the
> last argument of each function is misused or typoed.
> Add macro mechanisms to avoid this defect.
> stracpy (copy a string to a string array) must have a string
> array as the first argument (to) and uses sizeof(to) as the
> size.
> These mechanisms verify that the to argument is an array of
> char or other compatible types like u8 or unsigned char.
> A BUILD_BUG is emitted when the type of to is not compatible.

It would be nice to include some conversions.  To demonstrate the need,
to test the code, etc.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.