On Sat, Apr 22, 2017 at 08:14:06AM +0900, YASUOKA Masahiko wrote:
> On Fri, 21 Apr 2017 13:52:51 +0900 (JST)
> YASUOKA Masahiko <yasu...@openbsd.org> wrote:
> > +int
> > +pfctl_parse_host(char *str, struct pf_rule_addr *addr)
> > +{
> (snip)
> > +   if ((sbs = strchr(s, '[')) != NULL || (sbe = strrchr(s, ']')) != NULL) {
> > +           hints.ai_family = AF_INET6;
> > +           *(sbs++) = *sbe = '\0';
> 
> The condition must be
> 
>       if ((sbs = strchr(s, '[')) != NULL && (sbe = strrchr(s, ']')) != NULL) {
> 
> I will fix this before commit.
> 
> --yasuoka
> 

Hey,

Shouldn't it be:

        if ((sbs = strchr(s, '[')) != NULL && (sbe = strrchr(sbs, ']')) != 
NULL) {
                                                              ^

Since the ] should come after [ ?

-- 
Kind regards,
Hiltjo

Reply via email to