Commit Graph

500 Commits

Author SHA1 Message Date
Tim Rühsen 184da24502 Add support for native Win32 builds 2018-04-27 15:52:16 +02:00
Tim Rühsen e8c80a8470 Fix MinGW cros build on Linux 2018-04-27 15:52:15 +02:00
Tim Rühsen 517df86b99 Fix previous commit 2018-04-27 15:52:15 +02:00
Tim Rühsen 2d520d84fe Fallbacks for IDN library detection
When not explictly given --enable-runtime/--enable-builtin,
./configure tries to first detect libidn2, then libicu, then
libidn. If none found, it fals back to --disable-runtime and
--disable-builtin.

Reported-by: Chun-wei Fan
2018-04-27 15:52:14 +02:00
Chun-wei Fan 28180937ca src/psl.c: Fix build on Visual Studio
Visual Studio does not come with unistd.h, so only include it when we
have HAVE_UNISTD_H.  It also does not like including locale.h within
main() for some reason, so include that with the other system headers.
2018-04-27 15:52:13 +02:00
Chun-wei Fan de8b1d2871 fuzz: Skip the tests if fmemopen() is not found
fmemopen() is a function that is only provided with *NIX systems, so we
ought to check for its presence in order to build and run the tests
in fuzz/ fully, otherwise, we just skip the tests.

Also include headers according to how they are found, and add fallbacks
for Visual Studio that do not have stdint.h yet.
2018-04-27 15:52:12 +02:00
Tim Rühsen 3f511532de Make global vars static in test-is-public-all.c 2018-04-27 15:52:11 +02:00
Tim Rühsen dd44296e62 Remove leading _ from header guard 2018-04-27 15:52:11 +02:00
Tim Rühsen eba4c9f9a2 Remove unused vars in test-is-public-all.c 2018-04-27 15:52:10 +02:00
Tim Rühsen 5d27e573b8 Extend visibility support
Also renamed PSL_PUBLIC -> PSL_API (conforming to other known libraries).
2018-04-27 15:52:09 +02:00
Chun-wei Fan 11e2a32b4a libpsl.h.in: Decorate public symbols for export
Introduce a macro, PSL_PUBLIC, which is defined as nothing by default,
which can be used by the compiler to instruct the linker to export the
public symbols, such as __declspec (dllexport) on Visual Studio.
2018-04-27 15:52:08 +02:00
Chun-wei Fan 8767c48f43 src/psl.c: Make code compilable on native Windows
Include the Windows/Winsock2 counterparts of the networking headers on
Windows and avoid including *NIX-specific headers on Windows.

Also remove the small bits of C99isms from the code.
2018-04-27 15:52:07 +02:00
Emmanuele Bassi bbee21ff68 Fix non-srcdir builds
We need to modify the various paths we reference to include the build
directory, in the case when the build directory is not the source
directory.
2018-04-27 15:52:07 +02:00
Daniel Kahn Gillmor 8207e13cdc fix spelling errors 2018-04-27 15:52:06 +02:00
Tim Rühsen b9db5a7305 Fix make distcheck without enabled docs 2018-04-27 15:52:05 +02:00
Tim Rühsen 6aaf6f4620 Don't require xsltproc when not building man pages 2018-04-27 15:52:04 +02:00
Tim Rühsen 4e808b0496 Fix --disable-builtin configure option 2018-04-27 15:52:03 +02:00
Tim Rühsen bb53ff2d63 Release V0.20.1 2018-04-27 15:52:02 +02:00
Tim Rühsen adcf96fbbe Improve docs for PSL_TYPE_NO_STAR_RULE 2018-04-27 15:52:01 +02:00
Tim Rühsen 0410c72cd9 Add man page text about effect of --no-star-rule 2018-04-27 15:52:01 +02:00
Tim Rühsen 3b63c58722 Add --no-star-rule to psl utility 2018-04-27 15:52:00 +02:00
Tim Rühsen a19acd4299 Release v0.20.1 2018-04-27 15:51:59 +02:00
Tim Rühsen e901f5321f Fix PSL_TYPE_NO_STAR_RULE and improve test suite
Reported-by: Daniel Kahn Gillmor
2018-04-27 15:51:58 +02:00
Tim Rühsen dec2485114 Release v0.20.0 2018-04-27 15:51:57 +02:00
Tim Rühsen 3c28595151 Update copyrights 2018-04-27 15:51:57 +02:00
Tim Rühsen b42ca62b9c Update fuzzer to use PSL_TYPE_NO_STAR_RULE 2018-04-27 15:51:56 +02:00
Tim Rühsen 83fc0431e4 Update PSL submodule 2018-04-27 15:51:55 +02:00
Tim Rühsen c0cd25178b Add TLDs to (DAFSA) data to allow skipping the star rule 2018-04-27 15:51:54 +02:00
Claudio Saavedra db6f7b971c Add tests for PSL_TYPE_NO_STAR_RULE 2018-04-27 15:51:53 +02:00
Claudio Saavedra 737246856e psl_is_public_suffix2(): allow checking for suffixes not in the list
Add a PSL_TYPE_NO_STAR_RULE type to check for suffixes without the '*'
rule. This allows checking for suffixes that are not in the PSL.
2018-04-27 15:51:52 +02:00
Tim Rühsen 58ff15ca2c Remove C99 loop construct 2018-04-27 15:51:52 +02:00
Tim Rühsen 5c9e7e74ee Limit CPU wasting on large inputs
Large inputs on psl_registrable_domain() and psl_unregistrable_domain()
suffer from a O(N^2) behavior. This change limits N to avoid excessive
CPU usage.

At the same time we limit the fuzz corpora size to 64k which is far more
then we expect any real life domain to be.

Reported-by: OSS-Fuzz
2018-04-27 15:51:51 +02:00
Dagobert Michelsen 1f5db700ec Remove unconditional setting of GCC-specific flag 2018-04-27 15:51:50 +02:00
Tim Rühsen 5995c12be6 Update PSL submodule 2018-04-27 15:51:49 +02:00
Jeffrey Walton af2dbb83ec Expand defintion of PSL; add ICANN reference 2018-04-27 15:51:48 +02:00
Tim Rühsen 01a878ac88 Add missing include alloca.h in fuzz/main.c 2018-04-27 15:51:48 +02:00
Tim Rühsen fb29a889e4 Fix printf warnings in fuzz/main.c 2018-04-27 15:51:47 +02:00
Tim Rühsen 4fede219a1 Release v0.19.1 2018-04-27 15:51:46 +02:00
Tim Rühsen 8530d396c1 Fix unsigned integer overflow in _mem_is_ascii()
Found by OSS-Fuzz. It has no impact.
2018-04-27 15:51:45 +02:00
Tim Rühsen fa59acdeb8 Update corpora from oss-fuzz 2018-04-27 15:51:44 +02:00
Tim Rühsen a48169e6da psl_*_count() return -1 if information is not available 2018-04-27 15:51:43 +02:00
Tim Rühsen 4bfb18af61 Add psl_free_string to libpsl-sections.txt 2018-04-27 15:51:42 +02:00
Tim Rühsen 7785d6edb2 Amend start of comments in lookup_string_in_fixed_set.c 2018-04-27 15:51:41 +02:00
Tim Rühsen 4bcbb57936 Fix input encoding for python3 2018-04-27 15:51:41 +02:00
Darshit Shah 4d5982ed98 Add new function psl_free_string()
When writing a wrapper around LibPSL in a different language it is
important that libpsl provide functions to free any memory that it
allocates. Without this, it is impossible to correctly free the memory
allocated by psl_str_to_utf8lower() function since in other languages
one may not have access to the same free() call from libc.
2017-08-30 11:07:04 +02:00
Tim Rühsen d6c1051b37 Add m4/ax_check_compile_flag.m4 2017-07-27 11:55:29 +02:00
Tim Rühsen 0ff626f6b6 Update corpora from oss-fuzz 2017-07-27 11:36:18 +02:00
Tim Rühsen 4abb701b2c Improve fuzz/get_all_corpora 2017-07-27 11:29:29 +02:00
Tim Rühsen c1bf52dbc3 Add -fsanitize-address-use-after-scope to --enable-asan if available 2017-07-27 11:29:02 +02:00
Tim Rühsen c10ef083d6 Cleanup .travis_coveralls.sh 2017-07-27 11:07:00 +02:00