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] [day] [month] [year] [list]
Date:   Wed, 4 Oct 2023 16:18:02 -0700
From:   Bjorn Andersson <quic_bjorande@...cinc.com>
To:     Shubh <shubhisroking@...il.com>
CC:     Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        <linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy

On Wed, Oct 04, 2023 at 10:10:17AM +0530, Shubh wrote:
> Prefer `strscpy_pad` to `strncpy`.
> 
> Signed-off-by: Shubh <shubhisroking@...il.com>

Please spell out your name on future patches.

> ---
>  drivers/soc/qcom/cmd-db.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
> index 34c40368d..dc42704d7 100644
> --- a/drivers/soc/qcom/cmd-db.c
> +++ b/drivers/soc/qcom/cmd-db.c
> @@ -152,7 +152,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh,
>  	 * query string is not necessarily '\0' terminated if it bumps up
>  	 * against the max size. That's OK and expected.
>  	 */
> -	strncpy(query, id, sizeof(query));
> +	strscpy_pad(query, id, sizeof(query));

Please read the comment above, and please read fe72f9bce137 ("soc: qcom:
cmd-db: replace strscpy_pad() with strncpy()")

Thanks,
Bjorn

>  
>  	for (i = 0; i < MAX_SLV_ID; i++) {
>  		rsc_hdr = &cmd_db_header->header[i];
> -- 
> 2.42.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ