lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 12 Oct 2023 12:57:19 +0300
From:   Calvince Otieno <calvncce@...il.com>
To:     Bagas Sanjaya <bagasdotme@...il.com>
Cc:     outreachy@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Dan Carpenter <error27@...il.com>,
        Archana <craechal@...il.com>, Simon Horman <horms@...nel.org>,
        linux-staging@...ts.linux.dev
Subject: Re: [PATCH] staging/wlan-ng: remove strcpy() use in favor of strscpy()

Yes, strscpy() has the same behavior as strncpy(). It is preferred to
strncpy() since it always returns
a valid string, and doesn't unnecessarily force the tail of the
destination buffer to be zeroed.

On Thu, Oct 12, 2023 at 12:17 PM Bagas Sanjaya <bagasdotme@...il.com> wrote:
>
> On 12/10/2023 12:27, Calvince Otieno wrote:
> >               if (j == -1) {  /* plug the filename */
> >                       memset(dest, 0, s3plug[i].len);
> > -                     strncpy(dest, PRISM2_USB_FWFILE, s3plug[i].len - 1);
> > +                     strscpy(dest, PRISM2_USB_FWFILE, s3plug[i].len - 1);
>
> Is this strscpy() behavior same as previous strncpy()?
>
> --
> An old man doll... just what I always wanted! - Clara
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ