Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: mrt6_sysctl_mif wrong error declaration
To:
Alexander Bluhm <bluhm@openbsd.org>
Cc:
tech@openbsd.org
Date:
Sat, 02 Aug 2025 14:56:02 -0600

Download raw body.

Thread
Wow, that is pretty bad.

With that fixed, the loop looks correct when the edge of the space is hit.

ok deraadt


Alexander Bluhm <bluhm@openbsd.org> wrote:

> Hi,
> 
> Coverity figured out that error declaration shadows global error.
> So "if (error) return (error);" further down cannot reached.
> 
> ok?
> 
> bluhm
> 
> Index: netinet6/ip6_mroute.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet6/ip6_mroute.c,v
> diff -u -p -r1.153 ip6_mroute.c
> --- netinet6/ip6_mroute.c	25 Jul 2025 22:24:06 -0000	1.153
> +++ netinet6/ip6_mroute.c	2 Aug 2025 20:41:46 -0000
> @@ -348,8 +348,6 @@ mrt6_sysctl_mif(void *oldp, size_t *oldl
>  
>  		needed += sizeof(minfo);
>  		if (where && needed <= given) {
> -			int error;
> -
>  			error = copyout(&minfo, where, sizeof(minfo));
>  			if (error)
>  				break;
>