Fix SIGSEGV in test-is-public-all.c for TLD exceptions
This commit is contained in:
parent
f6a3b96f91
commit
0652af910e
|
@ -80,11 +80,13 @@ static void test_psl(void)
|
||||||
printf("psl_is_public_suffix(%s)=%d (expected 0)\n", p, result);
|
printf("psl_is_public_suffix(%s)=%d (expected 0)\n", p, result);
|
||||||
} else ok++;
|
} else ok++;
|
||||||
|
|
||||||
if (!(result = psl_is_public_suffix(psl, strchr(p, '.') + 1))) {
|
if ((p = strchr(p, '.'))) {
|
||||||
|
if (!(result = psl_is_public_suffix(psl, p + 1))) {
|
||||||
failed++;
|
failed++;
|
||||||
printf("psl_is_public_suffix(%s)=%d (expected 1)\n", strchr(p, '.') + 1, result);
|
printf("psl_is_public_suffix(%s)=%d (expected 1)\n", p + 1, result);
|
||||||
} else ok++;
|
} else ok++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (*p == '*') { /* a wildcard, e.g. *.ck */
|
else if (*p == '*') { /* a wildcard, e.g. *.ck */
|
||||||
if (!(result = psl_is_public_suffix(psl, p + 1))) {
|
if (!(result = psl_is_public_suffix(psl, p + 1))) {
|
||||||
failed++;
|
failed++;
|
||||||
|
|
Loading…
Reference in New Issue