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:   Mon, 29 Jul 2019 19:51:05 -0700
From:   Joe Perches <joe@...ches.com>
To:     Chuhong Yuan <hslester96@...il.com>
Cc:     Richard Henderson <rth@...ddle.net>,
        Ivan Kokshaysky <ink@...assic.park.msu.ru>,
        Matt Turner <mattst88@...il.com>, linux-alpha@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] alpha: Replace strncmp with str_has_prefix

On Tue, 2019-07-30 at 10:44 +0800, Chuhong Yuan wrote:
> In commit b6b2735514bc
> ("tracing: Use str_has_prefix() instead of using fixed sizes")
> the newly introduced str_has_prefix() was used
> to replace error-prone strncmp(str, const, len).
> Here fix codes with the same pattern.
> 
> Signed-off-by: Chuhong Yuan <hslester96@...il.com>
> ---
>  arch/alpha/boot/tools/objstrip.c | 3 ++-
>  arch/alpha/kernel/setup.c        | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c
[]
> @@ -148,7 +148,8 @@ main (int argc, char *argv[])
>  #ifdef __ELF__
>      elf = (struct elfhdr *) buf;
>  
> -    if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) {
> +	if (elf->e_ident[0] == 0x7f &&
> +		str_has_prefix((char *)elf->e_ident + 1, "ELF")) {

While the original indentation didn't use tabs,
please do not make it worse by misaligning.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ