Re: authpf: fix dead whitespace-trim loop in read_config

Alexandr Nedvedicky <[email protected]> Mon, 20 Jul 2026 18:12:31 +0200
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
Hello Avinash,


On Fri, Jul 17, 2026 at 04:29:50PM +0530, Avinash Duduskar wrote:
</snip>
> diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c
> index bc410c0631c..3984e4d78d2 100644
> --- a/usr.sbin/authpf/authpf.c
> +++ b/usr.sbin/authpf/authpf.c
> @@ -396,8 +396,8 @@ read_config(FILE *f)
>  		if (ap != &pair[2])
>  			goto parse_error;
>  
> -		tp = pair[1] + strlen(pair[1]);
> -		while ((*tp == ' ' || *tp == '\t') && tp >= pair[1])
> +		tp = pair[1] + strlen(pair[1]) - 1;
> +		while (tp >= pair[1] && (*tp == ' ' || *tp == '\t'))
>  			*tp-- = '\0';
>  
>  		if (strcasecmp(pair[0], "anchor") == 0) {
> 

I've just committed your diff.

thanks and
regards
sashan