RegexpURLValidator throws NPE when URL has no authority component

RegexpURLValidator.isValid() calls DomainNameUtil.isValidDomainAddress(values.getHost()) without null checking the host. The host is extracted from URL_REGEX capture group 2, which is null when the input has no authority component (e.g. http:host.com missing //). The regex still matches, so parseUrl() returns a non null ValueHolder with a null host, and DomainNameUtil.isValidDomainAddress(null) throws NPE at line 78.

Version: hibernate-validator-9.1.0.Final

I’m not sure if this is the right place to report this issue. If not, please point me in the right direction. Thanks

Please report issues on the issue tracker: Jira

See also Come and join us! - Hibernate

Thanks, my problem is that I don’t have a Jira account. I’ll go ahead and create one.

I created the account but I can’t open an issue:
“You do not have permission to perform this operation. Please log in. Close this window and press reload in your browser.” Also, most of the time the “+ Create” button doesn’t work at all.

Hey, there’s a known issue with Jira .. see this thread on how to deal with this: #hibernate-user > Jira issue creation @ :speech_balloon: