diff --git a/usr.sbin/mrouted/cfparse.y b/usr.sbin/mrouted/cfparse.y index 2da4da36fcc6..b97bbed72265 100644 --- a/usr.sbin/mrouted/cfparse.y +++ b/usr.sbin/mrouted/cfparse.y @@ -347,7 +347,8 @@ interface : ADDR { $$ = $1; } addrname : ADDR { $$ = $1; } | STRING { struct hostent *hp; - if ((hp = gethostbyname($1)) == NULL) + if ((hp = gethostbyname($1)) == NULL || + hp->h_length != sizeof($$)) fatal("No such host %s", $1); if (hp->h_addr_list[1])