]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: Don't allow a leading period when wildcard matching
authorSean Bright <sean@seanbright.com>
Tue, 26 May 2026 14:05:48 +0000 (14:05 +0000)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 1 Jun 2026 15:36:28 +0000 (15:36 +0000)
The reference identifier (what the client provides - in this case a
hostname) must start with a domain label, not a `.`.

The current implementation will match `.seanbright.com` against
`*.seanbright.com` which is incorrect.

res/res_pjsip/pjsip_transport_events.c

index 65a740cb2c98d06f11c1feb7c548ebdc68a64f7d..5aeb8f87b43c05957f90b7cfdd64d33c546d8dcd 100644 (file)
@@ -212,7 +212,7 @@ static int verify_cert_name(const pj_str_t *local, const pj_str_t *remote)
        }
 
        p = pj_strchr(local, '.');
-       if (!p) {
+       if (!p || p == pj_strbuf(local)) {
                return 0;
        }