From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/5] lib: string: Fix strlcpy return value
Date: Wed, 24 Mar 2021 20:54:55 -0400 [thread overview]
Message-ID: <eb1e672f-5b36-4fe9-8b5a-7082386d3a08@gmail.com> (raw)
In-Reply-To: <CAPnjgZ28kGWBUqN4OOQ7aY-G_f2OQ=NkhhDfHCk3h1QeBPQoEQ@mail.gmail.com>
On 3/24/21 8:38 PM, Simon Glass wrote:
> Hi Sean,
>
> On Thu, 11 Mar 2021 at 18:15, Sean Anderson <seanga2@gmail.com> wrote:
>>
>> strlcpy should always return the number of bytes copied. We were
>> accidentally missing the nul-terminator. We also always used to return a
>> non-zero value, even if we did not actually copy anything.
>>
>> Fixes: 23cd138503 ("Integrate USB gadget layer and USB CDC driver layer")
>>
>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>> ---
>>
>> Changes in v2:
>> - New
>>
>> lib/string.c | 12 ++++++++----
>> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> Please can you add a test while you are here? Might be easier on the
> -next branch.
This is tested in patch 3 as strlcat is implemented with strlcpy. Though
it looks like I will need to change the implementation...
--Sean
>
> Regards,
> Simon
>
next prev parent reply other threads:[~2021-03-25 0:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 5:15 [PATCH v2 0/5] string: strl(cat|cpy) Sean Anderson
2021-03-11 5:15 ` [PATCH v2 1/5] lib: string: Fix strlcpy return value Sean Anderson
2021-03-25 0:38 ` Simon Glass
2021-03-25 0:54 ` Sean Anderson [this message]
2021-03-25 2:40 ` Simon Glass
2021-03-25 0:53 ` Sean Anderson
2021-04-13 14:28 ` Tom Rini
2021-03-11 5:15 ` [PATCH v2 2/5] lib: string: Implement strlcat Sean Anderson
2021-03-25 0:38 ` Simon Glass
2021-04-13 14:28 ` Tom Rini
2021-03-11 5:15 ` [PATCH v2 3/5] test: Add test for strlcat Sean Anderson
2021-03-25 0:38 ` Simon Glass
2021-04-13 14:29 ` Tom Rini
2021-03-11 5:15 ` [PATCH v2 4/5] fastboot: Fix possible buffer overrun Sean Anderson
2021-04-13 14:29 ` Tom Rini
2021-03-11 5:15 ` [PATCH v2 5/5] checkpatch: Add warnings for using strn(cat|cpy) Sean Anderson
2021-03-25 0:38 ` Simon Glass
2021-04-13 14:29 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eb1e672f-5b36-4fe9-8b5a-7082386d3a08@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.