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, 13 Dec 2018 20:29:50 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Masayoshi Mizuma <msys.mizuma@...il.com>
Cc:     Chao Fan <fanc.fnst@...fujitsu.com>, linux-kernel@...r.kernel.org,
        x86@...nel.org, tglx@...utronix.de, mingo@...hat.com,
        hpa@...or.com, keescook@...omium.org, bhe@...hat.com,
        indou.takao@...fujitsu.com, caoj.fnst@...fujitsu.com
Subject: Re: [PATCH v13 2/6] x86/boot: Introduce get_acpi_rsdp() to parse
 RSDP in cmdline from KEXEC

On Thu, Dec 13, 2018 at 02:25:30PM -0500, Masayoshi Mizuma wrote:
> > +	len = cmdline_find_option("acpi_rsdp", val, MAX_ADDRESS_LENGTH+1);
> 
> sizeof() is better here.
> 
> 	len = cmdline_find_option("acpi_rsdp", val, sizeof(var));

Why is it better?

That makes you go look for the "val" variable and see what it's size is.
MAX_ADDRESS_LENGTH+1 is OTOH explicit.

> 
> > +	if (len > 0) {
> > +		val[len] = 0;
> 
> '\0' should be fine here not 0.
> 
> 		val[len] = '\0';

Yes.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ