New fuzz/libpsl_load_fuzzer.c plus corpus directory
This commit is contained in:
parent
6ca1304bd4
commit
666c07b364
|
@ -5,11 +5,13 @@ LDADD = ../src/libpsl.la
|
|||
|
||||
PSL_TESTS = \
|
||||
libpsl_fuzzer$(EXEEXT) \
|
||||
libpsl_load_fuzzer$(EXEEXT) \
|
||||
libpsl_load_dafsa_fuzzer$(EXEEXT)
|
||||
|
||||
check_PROGRAMS = $(PSL_TESTS)
|
||||
|
||||
libpsl_fuzzer_SOURCES = libpsl_fuzzer.c main.c fuzzer.h
|
||||
libpsl_load_fuzzer_SOURCES = libpsl_load_fuzzer.c main.c fuzzer.h
|
||||
libpsl_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c main.c fuzzer.h
|
||||
|
||||
dist-hook:
|
||||
|
|
|
@ -57,16 +57,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||
psl_free(psl);
|
||||
fclose(fp);
|
||||
|
||||
// non-DAFSA load
|
||||
fp = fmemopen(in + 16, size, "r");
|
||||
if (!fp && size) // libc6 < 2.22 return NULL when size == 0
|
||||
assert(1);
|
||||
|
||||
psl = psl_load_fp(fp);
|
||||
psl_free(psl);
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
|
||||
psl = psl_latest(NULL);
|
||||
psl_free(psl);
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright(c) 2017 Tim Ruehsen
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* This file is part of libpsl.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <assert.h> // assert
|
||||
#include <stdint.h> // uint8_t
|
||||
#include <stdlib.h> // malloc, free
|
||||
#include <string.h> // memcpy
|
||||
|
||||
#include "libpsl.h"
|
||||
#include "fuzzer.h"
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
psl_ctx_t *psl;
|
||||
|
||||
FILE *fp = fmemopen((void *)data, size, "r");
|
||||
if (!fp && size) // libc6 < 2.22 return NULL when size == 0
|
||||
assert(1);
|
||||
|
||||
psl = psl_load_fp(fp);
|
||||
psl_is_public_suffix(NULL, NULL);
|
||||
psl_is_public_suffix(psl, ".ü.com");
|
||||
|
||||
psl_free(psl);
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
begin_icann="// ===BEGIN ICANN DOMAINS==="
|
||||
end_icann="// ===END ICANN DOMAINS==="
|
||||
begin_private="// ===BEGIN PRIVATE DOMAINS==="
|
||||
end_private="// ===END PRIVATE DOMAINS==="
|
||||
wildcard1="*.ck"
|
||||
exception1="!www.ck"
|
||||
wildcard2="*.kawasaki.jp"
|
||||
exception1="!city.kawasaki.jp"
|
||||
idn1="\xe5\x85\xac\xe5\x8f\xb8.cn"
|
|
@ -0,0 +1 @@
|
|||
<05>;
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
!c!city.kawasaki.jpk;*
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
™.jp
|
||||
**.p
|
||||
*.kŸwa¯;¸s
|
||||
™.jp
|
||||
*p.p
|
||||
*awasaŸwa¯asaŸwa¯¸spS===;¸spS=
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
// ===BEGIN ICANN DOMAINS====AINS==Ÿ
|
||||
// ===
|
||||
//
|
||||
// ===
|
||||
// ==END
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
!ck公司.c!cn;
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
.DAFSA@PSL_ックsY
|
||||
pcccccccccccccccccccccccccccccccccccccccccccccpi
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
|
||||
..................ョ..............ョ
|
|
@ -0,0 +1,4 @@
|
|||
/=
|
||||
/=!==
|
||||
/=!pp===
|
||||
/=!p===BEGIN D*.ckNS===!city.kawasaki.jp
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
!<21><>
|
||||
// ===// =
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
/=3
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
|
||||
;
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
.DAFSA@PSL_¯¸s;
|
||||
™.jp
|
||||
p*.pi
|
||||
..jp
|
||||
på<EFBFBD>.
|
||||
¸kp.Ÿšppi
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
// ===// ===BEGIN ICANN DOMAINS===;
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
.DAFSA@PSL_Ż¸s;
|
||||
™
|
||||
kźw˙˙˙˙˙˙˙˙˙˙aŻ;¸s
|
||||
|
||||
p.kźw
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
™.jp
|
||||
*.p
|
||||
*.kŸwa¯;¸s
|
||||
™.jp
|
||||
pawasaŸwa¯asaŸwa¯¸spS===;¸spS=
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
!ck公司.cn!www.ck;
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
// ==!p===BEGIN IC===BEGIN PRIVATE DOMAINS===Ÿ
|
||||
// ===END===END
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
*.*.kawaü.compp
|
||||
'公司.cnsakikawaü.compp
|
||||
'a公司.cnsakinpp
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
:........ョ..............ョ
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
<EFBFBD>!ck
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
// ==!p=====BEGIN PRIVATE DOMAINS=====Ÿ
|
||||
// ===
|
||||
// ===
|
||||
// ==END
|
|
@ -0,0 +1,3 @@
|
|||
™pppppp
|
||||
'™;*.kawasaki.jp
|
||||
™*pppVVVV<56><56>pppå;…¬å<C2AC>¸,cnpp
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
!<21>.<2E>cn;
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
;å*å.Ÿ…k¬wa
|
||||
™.jp¯¸s;
|
||||
™.jp
|
||||
p..jp¯¸s;
|
||||
™.jp
|
||||
p.¸s
|
||||
™.j.p
|
||||
p<EFBFBD>¸.pk
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
!ck;
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
|
||||
// ==!p=====BEGIN PRIVATE DOMAINS=====Ÿ
|
||||
// ===
|
||||
// ===UND===END
|
|
@ -0,0 +1,2 @@
|
|||
.DAFSA@PSL_¯¸s;
|
||||
™;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue