Add function calls to fuzz/libpsl_fuzzer.c

This commit is contained in:
Tim Rühsen 2017-06-12 17:07:54 +02:00
parent 9da4e94c1a
commit e8f083e867
1 changed files with 10 additions and 1 deletions

View File

@ -34,7 +34,8 @@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
char *domain = (char *) malloc(size + 1);
char *domain = (char *) malloc(size + 1), *res;
int rc;
assert(domain != NULL);
@ -44,10 +45,18 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
psl_ctx_t *psl;
psl = (psl_ctx_t *) psl_builtin();
psl_is_public_suffix(NULL, domain);
psl_is_public_suffix(psl, domain);
psl_is_public_suffix2(psl, domain, PSL_TYPE_PRIVATE);
psl_is_public_suffix2(psl, domain, PSL_TYPE_ICANN);
psl_is_cookie_domain_acceptable(psl, "", NULL);
psl_is_cookie_domain_acceptable(psl, "a.b.c.e.com", domain);
if ((rc = psl_str_to_utf8lower(domain, "utf-8", NULL, &res)) == PSL_SUCCESS)
free(res);
psl_free(psl);
free(domain);