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:   Tue, 30 Jul 2019 11:17:57 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Chuhong Yuan <hslester96@...il.com>
cc:     LKML <linux-kernel@...r.kernel.org>, Marc Zyngier <maz@...nel.org>
Subject: Re: [PATCH 05/12] genirq/debugfs: Replace strncmp with
 str_has_prefix

On Mon, 29 Jul 2019, Chuhong Yuan wrote:

> strncmp(str, const, len) is error-prone.
> We had better use newly introduced
> str_has_prefix() instead of it.

Can you please provide a proper explanation why the below strncmp() is
error prone?

Just running a script and copying some boiler plate changelog saying
'strncmp() is error prone' does not cut it.

> -	if (!strncmp(buf, "trigger", size)) {
> +	if (str_has_prefix(buf, "trigger")) {

Especially when the resulting code is not equivalent.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ