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:   Sat, 6 Aug 2022 01:40:33 +0300
From:   Konstantin Shelekhin <k.shelekhin@...ro.com>
To:     <ojeda@...nel.org>
CC:     <boqun.feng@...il.com>, <gregkh@...uxfoundation.org>,
        <jarkko@...nel.org>, <linux-fsdevel@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <patches@...ts.linux.dev>,
        <rust-for-linux@...r.kernel.org>, <torvalds@...ux-foundation.org>
Subject: Re: [PATCH v9 01/27] kallsyms: use `sizeof` instead of hardcoded size

> diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
> index f18e6dfc68c5..52f5488c61bc 100644
> --- a/scripts/kallsyms.c
> +++ b/scripts/kallsyms.c
> @@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in)
>  
>  	rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name);
>  	if (rc != 3) {
> -		if (rc != EOF && fgets(name, 500, in) == NULL)
> +		if (rc != EOF && fgets(name, sizeof(name), in) == NULL)
>  			fprintf(stderr, "Read error or end of file.\n");
>  		return NULL;
>  	}

Might be another nit, but IMO it's better to use ARRAY_SIZE() here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ