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]
Message-Id: <85985E13-E12F-4C4A-A9AC-374C0E28312E@gmail.com>
Date:	Sun, 10 Aug 2014 17:58:46 -0700
From:	Mark D Rustad <mrustad@...il.com>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc:	Hyong-Youb Kim <hykim@...i.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: ethernet: myricom: myri10ge: myri10ge.c:  Cleaning up missing null-terminate after strncpy call

On Aug 9, 2014, at 4:40 PM, Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se> wrote:

> Added a guaranteed null-terminate after call to strncpy.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---
> drivers/net/ethernet/myricom/myri10ge/myri10ge.c |    1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> index f3d5d79..de327b6 100644
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> @@ -574,6 +574,7 @@ myri10ge_validate_firmware(struct myri10ge_priv *mgp,
> 
> 	/* save firmware version for ethtool */
> 	strncpy(mgp->fw_version, hdr->version, sizeof(mgp->fw_version));
> +	mgp->fw_version[sizeif(mgp->fw_version) - 1] = '\0';

Surely you meant sizeof above. Did you really not even compile this?

> 	sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major,
> 	       &mgp->fw_ver_minor, &mgp->fw_ver_tiny);

-- 
Mark Rustad, MRustad@...il.com


Download attachment "signature.asc" of type "application/pgp-signature" (842 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ