Compare commits

...

214 Commits

Author SHA1 Message Date
George Sokianos 92d3ef3d19 Changes in the Makefile.os4 to fully compile 2023-01-11 00:23:36 +00:00
George Sokianos 9098ed0e31 Added OS4 makefile 2023-01-10 23:51:34 +00:00
Chun-wei Fan c47cf796fc tools/psl.c: Fix build on Windows
localtime_r() is not available on Windows but a more-secure variant
of localtime(), localtime_s() is provided on Windows.

Define localtime_r() on Windows as its arguments are reversed as compared
to localetime_s(), to achive more or less the same purpose.
2022-12-27 11:09:14 +01:00
Chun-wei Fan 86923341a3 meson: Clean up ICU dependency search
Since we are using Meson 0.60.0 or later, use CMake to help us find ICU,
which is cleaner and more comprehensive, and allows us to use libicu_dep
= depedency(...) even on Visual Studio, where CMake will find the
appropriate ICU headers and libraries for us internally.

Sadly, due to peculiarities, we have to live with the warning that comes
up as we needed to look for ICU in the older method instead of the
recommended modules: ['ICU::uc'] method.
2022-12-27 11:07:54 +01:00
Tim Rühsen 927b202c69 Release v0.21.2 2022-12-26 13:46:23 +01:00
Tim Rühsen f2bdc1709d tools/psl.c: Use localtime_r instead of localtime 2022-12-09 13:38:14 +01:00
Tim Rühsen 5eaa8b4796 CI: Install missing autopoint 2022-12-09 13:28:57 +01:00
Tim Rühsen c03f48aa24 Update PSL 2022-12-09 13:28:57 +01:00
LGTM Migrator 4cb5c0cea0 Add CodeQL workflow for GitHub code scanning 2022-12-09 13:10:11 +01:00
Matt Turner 182bfd0e5f Use AC_SYS_LARGEFILE
Ensures that calls to fopen() and stat() can handle largefiles.
2022-11-06 19:31:50 +01:00
Cœur c546aafc0a Fix "Although the value stored to 'pos' is used in the enclosing expression, the value is never actually read from 'pos'" 2022-10-15 19:06:05 +02:00
Eli Schwartz b9503b64c3 meson: fix regression that made it impossible to build
In commit aa4909766c an option was
modified and changed its type from a list of possible strings to a
true/false value.

However, the build wasn't updated to correspond to that change, so it
didn't logically work -- and Meson even threw a type error saying you
cannot compare strings to booleans.

The actual change was basically "do not use this option anymore except
to pass a macro to the source file and embed the data at all". So we can
simply get rid of a bunch of complex dependency conditionals.

Fixes #185
2022-07-26 12:16:13 +02:00
Tim Rühsen a7b63cbb35
Merge pull request #183 from neheb/patch-1
meson: switch iconv to meson's handling
2022-06-10 15:54:38 +02:00
Tim Rühsen cf6878fd24 Update PSL submodule 2022-06-10 15:51:21 +02:00
Tim Rühsen 7a4cbdd386
Merge pull request #181 from hwti/builtin-option
Make builtin option independant from runtime one
2022-06-10 15:49:58 +02:00
Rosen Penev b27d4b69ce
meson: switch iconv to meson's handling
Fixes compilation under OpenWrt.
2022-06-09 17:01:18 -07:00
Loïc Yhuel aa4909766c Make builtin option independant from runtime one
Since commit deabd4a, psl2c has been replaced by psl-make-dafsa.
The builtin PSL data is always generated the same way, and the value of the builtin
configure option does not matter anymore.

The built-in data is now embedded by default (instead of the previous "auto"), unless
explicitly disabled by --disable-builtin/-Dbuiltin=false.

When not using an run-time runtime IDNA library (--disable-runtime/-Druntime=no), libpsl can
now include the built-in data without any build-time dependency.
2022-06-06 22:48:32 +02:00
Tim Rühsen 6a82bcbc2a Fix comments from C++ to C/C++ in psl-make-dafsa 2022-06-06 12:32:17 +02:00
Tim Rühsen 664f3dc852
Merge pull request #180 from eugmes/remove-macro
Remove definition of _GCC_VERSION_AT_LEAST
2022-02-18 19:39:29 +01:00
Ievgenii Meshcheriakov 9d39483d42 Remove definition of _GCC_VERSION_AT_LEAST
This macro is unused and is the only piece for compiler-specific
code in this file.
2022-02-18 16:57:35 +01:00
Tim Rühsen 67aadbe967 Remove obsolete fuzzer builds from fuzz/run-clang 2022-01-16 19:36:07 +01:00
Tim Rühsen 54038ae4d9 Require gettext version 0.19.3 2022-01-16 19:14:33 +01:00
Tim Rühsen 97f8ae52c1 Update fuzzing tools and build scripts 2022-01-16 12:59:23 +01:00
Tim Rühsen 21d2d51911 Avoid 'NULL + 1' as it is UB 2022-01-16 12:55:51 +01:00
Tim Rühsen 55d0ae04de Avoid 8bit overflow in is_public_suffix() 2022-01-16 12:51:33 +01:00
Tim Rühsen 042c586371 Update corpora from OSS-FUZZ 2022-01-16 12:08:01 +01:00
Tim Rühsen 1023a9ad12 Fix stack buffer overflow WRITE 1 in domain_to_punycode()
Reported-by: oss-fuzz (issue 39424 and issue 39226)

The affected code would only be built into the library when
configured to build without any IDNA library.
2022-01-15 22:38:36 +01:00
Tim Rühsen 044b5ed5d4 Bump gettext version to 0.19.3 2022-01-15 14:26:06 +01:00
Tim Rühsen be03c8ef97 Update m4/ax_check_compile_flag.m4 2022-01-15 14:18:37 +01:00
Tim Rühsen 864d938f39 Add brackets for AC_INIT argument 2022-01-15 14:18:18 +01:00
Tim Rühsen 5f796be788
Merge pull request #177 from equeim/meson-static
meson: automatically add PSL_STATIC define when building Windows static library and fix tests/tools link errors
2022-01-15 13:54:28 +01:00
Alexey Rochev 1159bd46c3 meson: fix tests/tools link errors when building shared library for Windows
We need to link them with ws2_32 explicitly.
2022-01-13 01:55:03 +03:00
Alexey Rochev ba6f11f751 meson: automatically add PSL_STATIC define when building Windows static library 2022-01-13 01:54:38 +03:00
Tim Rühsen 4a10a1698b
Merge pull request #179 from equeim/meson-libicu-static
Use C++ linker when building with libicu
2022-01-08 19:43:10 +01:00
Alexey Rochev 02c8476071 Use C++ linker when building with libicu
ICU is a C++ library, event though it has C interface.
Therefore we have to use C++ linker when linking with it.
2022-01-07 01:12:17 +03:00
Tim Rühsen 88a75d4711
Merge pull request #178 from equeim/tests-libicu
Fix Meson build
2022-01-06 19:29:39 +01:00
Alexey Rochev 5a29a64444 Remove libicu includes from test-registrable-domain.c
It doesn't seem like they are used,
and they cause build failures with meson.
2022-01-06 03:03:43 +03:00
Alexey Rochev 43fc4f0631 meson: bring back libiconv dependency lookup 2022-01-06 03:03:43 +03:00
Alexey Rochev 0ecc788797 Remove meson.build generation and separate project and library versions in their own files
Project and library version are now stored in
version.txt and libtool_version_info.txt files respectively.
Both autotools and meson get their versioning information from this files.
Meson additionally automatically transforms library version
from libtool's own format.

Also raise meson version requirement from 0.47 to 0.57 which
is required by these changes.
2022-01-06 03:02:33 +03:00
Tim Rühsen 4afd9e705b
Merge pull request #174 from rockdaboot/tmp-wsa-startup
Add WSAStartup() for Windows psl tool and tests.
2021-11-26 19:18:19 +01:00
Tim Rühsen f5035b854b Add WSAStartup() for Windows psl tool and tests.
As reported at https://github.com/rockdaboot/libpsl/issues/173,
psl_is_cookie_domain_acceptable() doesn't work properly without
WSAStartup() on Windows.

Co-authored-by: gvanem@yahoo.no
2021-11-26 19:10:37 +01:00
Tim Rühsen b2625f93f2 Fix write buffer overflow by 1 in domain_to_punycode()
This issue has been triggered after the previous commit increased
the size of label_buf.

It has been found by OSS-Fuzz (issue 39226).
The testcase is included into the unit tests.
2021-09-26 18:02:04 +02:00
Tim Rühsen 304ca77522 Increase label size from 48 -> 128 2021-09-18 12:24:45 +02:00
Tim Rühsen 50ff7f2edf Update upstream PSL 2021-09-18 12:22:16 +02:00
Tim Rühsen 6ce6c4e399
Merge pull request #168 from nacho/nacho/gtk-doc
meson: build reference manual with gtk_doc
2021-01-31 17:38:23 +01:00
Ignacio Casal Quinteiro a1b91e86e4 meson: build reference manual with gtk_doc 2021-01-26 12:38:01 +01:00
Tim Rühsen 6f4f6d766c Replace obsolete AC_HELP_STRING with AS_HELP_STRING 2021-01-16 18:16:35 +01:00
Tim Rühsen 99e7e6a2af
Merge pull request #166 from quink-black/fix-build-iconv
Add libiconv dep to meson build again
2021-01-16 18:07:35 +01:00
Tim Rühsen 44443ad3a4 Update PSL data from upstream 2021-01-16 17:56:23 +01:00
Tim Rühsen fef1568bef
Merge pull request #167 from SteelPangolin/meson-install-more
Meson: install libpsl man page, DAFSA builder
2021-01-16 17:46:39 +01:00
Erica Ehrhardt 62081a021f Meson: install libpsl man page, DAFSA builder
Partially addresses issue #136,
at least when building from a distribution tarball.
2021-01-14 17:13:46 -08:00
Zhao Zhili 5b63816e82 Add libiconv dep to meson build again
Build success on macOS and ubuntu.
2021-01-07 20:59:17 +08:00
Tim Rühsen 6a5e41edc5
Merge pull request #164 from tp-m/fix-meson-build
meson: fix build
2020-10-26 21:27:11 +01:00
Tim-Philipp Müller 8e02c2c4f1 meson: fix build
src/meson.build:19:0: ERROR: Unknown variable "libiconv".
2020-10-26 10:46:53 +00:00
Tim Rühsen d61859f4b5
Merge pull request #163 from rockdaboot/tmp-doc-buildfromtarball
Add 'Building from tarball' to README.md
2020-10-25 11:56:20 +01:00
Tim Rühsen 5ccf1e85fe Add 'Building from tarball' to README.md 2020-10-25 11:55:17 +01:00
Tim Rühsen 03df58fc96
Merge pull request #162 from thinkski/master
Add libiconv dep to meson build
2020-09-21 16:22:17 +02:00
Chris Hiszpanski 079e8d0f6c Add libiconv dep to meson build 2020-09-20 04:57:12 -07:00
Tim Rühsen 17cce94216
Merge pull request #158 from kloczek/master
Install psl executable and man pages.
2020-08-05 20:06:12 +02:00
Tomasz Kłoczko 47bab910ee Install psl executable and man pages.
Resolve #156
2020-08-05 18:38:11 +01:00
Tim Rühsen a5e6f26cce Release V0.21.1 2020-07-18 13:15:00 +02:00
Tim Rühsen 0073dd737d
Merge pull request #155 from damz/pr/fix-coveralls
Upgrade Ubuntu to fix the coveralls issue
2020-07-02 18:52:47 +02:00
Damien Tournoud c471792664 Try if upgrading ubuntu helps with the coveralls issue 2020-07-02 09:43:52 -07:00
Tim Rühsen f5142207aa
Merge pull request #154 from kotnik/psh-test-update
Update Platform.sh example in test_data
2020-07-02 18:38:52 +02:00
Nikola Kotur f364cea73e Update Platform.sh example in test data 2020-07-02 17:04:27 +02:00
Tim Rühsen 72365d3036
Merge pull request #153 from nirbheek/fix-build-windows
meson: Fix running of psl-make-dafsa on Windows
2020-04-06 17:03:17 +02:00
Nirbheek Chauhan 0c11bf19df meson: Fix running of psl-make-dafsa on Windows
`find_program()` evaluates to `python psl-make-dafsa` on Windows, so
running it with `python` evaluates to `python python psl-make-dafsa`,
causing this error on Windows:

```
"c:/python38/python.exe" "python" "C:/projects/repos/libpsl/src/psl-make-dafsa" "--output-format=binary" "C:/projects/repos/libpsl/list/public_suffix_list.dat" "tests/psl.dafsa"
c:/python38/python.exe: can't open file 'python': [Errno 2] No such file or directory
```
2020-04-06 20:18:45 +05:30
Tim Rühsen 20ad8fb106
Merge pull request #152 from nirbheek/fix-typo
meson: Fix typo
2020-04-03 17:29:05 +02:00
Nirbheek Chauhan 116b5fe7b9 meson: Fix typo 2020-04-03 20:50:07 +05:30
Tim Rühsen 8d9e490ee7
Merge pull request #151 from nirbheek/fix-buildtype-usage
meson: Use the b_vscrt option for selecting the CRT
2020-04-03 15:22:51 +02:00
Nirbheek Chauhan a582a9c142 meson: Use the b_vscrt option for selecting the CRT
This option has been available since 0.48, and we should use it
instead of only guessing based on buildtype.
2020-04-03 16:45:11 +05:30
Tim Rühsen 96412ad0e0
Merge pull request #150 from ystreet/meson-python
meson: run python script against the meson version of python
2020-04-02 10:22:12 +02:00
Matthew Waters a10c374dad meson: run python script against the meson version of python
Avoids using a python that may not exist in a python3 only distribution:

/usr/bin/env: ‘python’: No such file or directory
2020-04-02 15:16:20 +11:00
Tim Rühsen d54ecbd05e Add meson check for strings.h 2020-03-10 15:57:33 +01:00
Tim Rühsen 55889b1d9e Add recent changes from meson.build to meson.build.in 2020-03-10 15:47:55 +01:00
Tim Rühsen b9a190264f psl.c: Include strings.h only if it is available 2020-03-10 15:16:25 +01:00
Tim Rühsen a2411a7207 Add Github FUNDING.yml 2020-03-07 20:42:04 +01:00
Tim Rühsen d26a0acfd7
Merge pull request #148 from nirbheek/meson-port
meson: Use libtool library versioning, same as autotools
2020-02-28 14:01:36 +01:00
Nirbheek Chauhan 841ae6dddd meson: Use libtool library versioning, same as autotools
This helps maintain ABI compatibility with the Autotools build so it's
a drop-in replacement.
2020-02-28 13:20:23 +05:30
Tim Rühsen fca622f587 Include string.h in src/psl.c 2020-02-01 17:04:36 +01:00
Tim Rühsen 39c2990840
Merge pull request #146 from fanc999/master.msv
Improve Visual Studio builds Add instructions
2019-10-30 14:32:02 +01:00
Chun-wei Fan 0e8addfe20 NMake builds: Make PDB generation cleaner
Separate the locations where the intermediate PDB files are generated,
to make things cleaner.
2019-10-30 18:09:00 +08:00
Chun-wei Fan 28319ed36f NMake builds: Include Visual Studio version in output dir
This avoids builds done with other Visual Studio versions being
confused with the one that is being used now.
2019-10-30 18:07:19 +08:00
Chun-wei Fan 3e92891d8c msvc/detectenv-msvc.mak: Accomdate Visual Studio 2019
This adds detection logic for Visual Studio 2019.
2019-10-30 17:36:38 +08:00
Chun-wei Fan f277af5bd8 Add instructions on building with MSVC
This includes building via NMake and Meson.
2019-10-30 17:36:06 +08:00
Chun-wei Fan 978e2989ca NMake: Fix building test programs
Define PSL_DAFSA and PSL_ASCII_DAFSA to point to the corresponding DAFSA
files that we generated during the build.
2019-10-30 15:26:02 +08:00
Tim Rühsen c6114a690c
Merge pull request #141 from blino/flags-fix
Fix auto flags for icu runtime and libidn builtin
2019-08-28 14:17:54 +02:00
Olivier Blin 75603d131d Fix auto flags for icu runtime and libidn builtin 2019-08-28 13:59:26 +02:00
Tim Rühsen e497735e45
Merge pull request #140 from rossburton/py
Makefile.am: use PYTHON when invoking psl-make-dafsa
2019-07-12 09:59:34 +02:00
Ross Burton b4fec5d0dd Makefile.am: use PYTHON when invoking psl-make-dafsa
In an environment where only Python 3 is installed, configure.ac finds and sets
PYTHON=python3 correctly but src/psl-make-dafsa is called directly, so the hashbang of
`#!/usr/bin/env python` is used which doesn't exist.

Fix this by explicitly running $(PYTHON) when using the tool.
2019-07-11 17:47:11 +01:00
Tim Rühsen 22a7e4045c
Merge pull request #139 from xhaakon/win32-build
Fix build when dirent.h is not available
2019-06-05 09:56:09 +02:00
Jakub Adam 49ce76a8cf Fix build when dirent.h is not available 2019-06-05 09:45:50 +02:00
Tim Rühsen f850de85ab
Merge pull request #138 from xclaesse/langinfo
Fix build when langinfo.h is not found
2019-06-03 22:06:14 +02:00
Xavier Claessens 93e3bb3e29 Fix build when langinfo.h is not found 2019-06-03 15:52:48 -04:00
Tim Rühsen 867872e80d Include stdio.h for fmemopen in fuzzers 2019-06-02 13:39:15 +02:00
Tim Rühsen f32c240cc0 Remove alloca from fuzz/main.c 2019-06-02 13:07:35 +02:00
Tim Rühsen 5131ef0d5d
Merge pull request #137 from kanavin/fix-tree-index
gtk-doc: do not include tree_index.sgml
2019-06-01 14:27:44 +02:00
Alexander Kanavin 87d1add318 gtk-doc: do not include tree_index.sgml
gtk-doc 1.30 no longer generates the file if the object tree is empty.
2019-06-01 13:13:50 +02:00
Tim Rühsen 999f28cc15 Use %NULL and %FILE overall in gtk-docs 2019-05-26 18:01:50 +02:00
Tim Rühsen 74ee95079d Add missing api-indeces for gtk-doc 2019-05-26 18:00:29 +02:00
Tim Rühsen ef352f8923 Add PSL_API to libpsl-sections.txt 2019-05-26 17:59:44 +02:00
Tim Rühsen 87715ba378
Merge pull request #131 from sunpoet/master
Fix build when configured with --with-psl-file
2019-04-17 15:57:06 +02:00
Po-Chuan Hsieh 9347024221
Fix build when configured with --with-psl-file
The error message is as follows:
Making all in tests
make: don't know how to make ../list/public_suffix_list.dat. Stop

make: stopped in /usr/ports/works/usr/ports/dns/libpsl/work/libpsl-libpsl-0.21.0/tests
*** Error code 1

Stop.
2019-04-17 13:25:48 +00:00
Tim Rühsen 8b913fe484 Dynamically create version in meson.build 2019-04-17 12:46:46 +02:00
Tim Rühsen 082ee9740e Fix patch version in include/meson.build 2019-04-17 12:33:03 +02:00
Tim Rühsen 94a7e7c6ed Include meson build files into tarball 2019-04-17 12:05:00 +02:00
Tim Rühsen 1eaf180359 Release V0.21.0 2019-04-16 15:10:17 +02:00
Tim Rühsen e02ac83d93 Add building of an lzip tarball archive 2019-04-16 14:42:34 +02:00
Tim Rühsen 46a990736c Create test DAFSAs if older than public_suffix_list.dat 2019-04-05 15:08:32 +02:00
Tim Rühsen 35c781924f Update PSL data from upstream 2019-04-05 15:04:57 +02:00
Tim Rühsen 0c85c95dd1
Merge pull request #126 from xhaakon/master
Windows: Define ssize_t for MSVC
2019-04-05 15:01:46 +02:00
Jakub Adam c230a7b48b Windows: MSVC doesn't define ssize_t 2019-04-05 13:15:34 +02:00
Tim Rühsen 19359c6733
Merge pull request #124 from carlo-bramini/fix-older-windows
Fix older windows
2019-03-26 12:55:25 +01:00
carlo-bramini 7dcb69eb1d Windows: decrease minimum version to NT2000
Use WSAStringToAddressW() instead of inet_pton()

Undefine _WIN32_WINNT before (re)define it.
Fix if this macro is already declared somewhere.

Just add Winsock, no need to test anymore.

The number of characters must be used.

Use countof() macro instead

Improved fixes for Windows
2019-03-26 12:04:22 +01:00
Tim Rühsen b32e81367c
Merge pull request #125 from nacho/fix-msvc-icu-debug
meson: on msvc icu installs the libraries with a "d" suffix
2019-01-21 13:18:04 +01:00
Ignacio Casal Quinteiro 0bd3ae2a0c meson: on msvc icu installs the libraries with a "d" suffix 2019-01-21 12:20:53 +01:00
Tim Rühsen c6fdf56b20 msvc/*.py: Let main() return 0 2019-01-11 21:59:06 +01:00
Ignacio Casal Quinteiro 726d6773d4 meson: install the library 2018-12-31 17:01:00 +01:00
Ignacio Casal Quinteiro b61285e74d meson: install the header file 2018-12-31 16:57:56 +01:00
Tim Rühsen ad895e382a Silence format warning on printing time_t 2018-12-31 16:51:48 +01:00
Tim Rühsen b38320fd42 Update PSL data from upstream 2018-12-29 19:26:50 +01:00
Tim Rühsen 80c0d5ff22 Add contrib/spell-checker 2018-12-28 19:45:30 +01:00
Tim Rühsen c9315f26bc Fix typos 2018-12-28 19:44:39 +01:00
Chun-wei Fan df873db543 meson: Ensure things build with Windows
We must link to ws2_32.lib for all Windows builds, and we need to use
workarounds for alloca() and snprintf() since Visual Studio uses
_alloca() for alloca() and provides snprintf() only on Visual Studio
2015 or later, meaning that we need to use _snprintf() here.

Also fix the parts where we run the Python scripts to generate items,
since those scripts already have shebang lines for Meson to pick up.
2018-12-11 09:28:51 +08:00
Tim Rühsen 6a47e7c527 Meson: Build libpsl version number without external command 2018-12-10 21:02:33 +01:00
Tim Rühsen c3133c7fd6 Meson: Add ASAN build to contrib/check-hard-meson 2018-12-09 18:30:41 +01:00
Tim Rühsen c8c9c5a391 Meson: Add contrib/check-hard-meson 2018-12-09 14:34:45 +01:00
Tim Rühsen 04da21e2e9 Meson: Include config.h in tests 2018-12-09 14:33:56 +01:00
Tim Rühsen 73b734c364 Fix C89 warnings in fuzz/main.c 2018-12-08 23:38:45 +01:00
Tim Rühsen 6ef129be93 Fix include path in fuzz/main.c 2018-12-08 23:27:28 +01:00
Tim Rühsen 277b82bca2 Fix C++ comment to C 2018-12-08 23:22:06 +01:00
Xavier Claessens a9c3b6df39 Meson: Fallback to find_library if no pkg-config file is found 2018-12-08 14:13:51 -05:00
Xavier Claessens ed5f23d69a Meson: Fix srcdir pointing to root source dir instead of current subdir 2018-12-08 12:49:20 -05:00
Tim Rühsen 22f3ecdb12
Merge pull request #117 from xclaesse/meson-fuzz
Meson: Fix fuzz test names
2018-12-08 16:57:24 +01:00
Xavier Claessens 81a793346e Meson: Fix fuzz test names 2018-12-08 10:11:17 -05:00
Xavier Claessens 13bf8e102e Meson: Fix link of fuzzer tests
libicu is an internal dependency of libpsl, so if an executable
uses libicu directly, linking on libpsl is not enough, it must also
link on libicu.

Closes: #115
2018-12-08 08:12:17 -05:00
Tim Rühsen 77971566d3 Meson: Fix issues in meson.build, remove building fuzz/ 2018-12-08 13:50:36 +01:00
Tim Rühsen 2483cb608d Mention meson and nmake build in README.md 2018-12-08 10:59:07 +01:00
Xavier Claessens 77c10beab7 Add initial Meson build system 2018-12-07 09:54:20 -05:00
Tim Rühsen aae1995ca7
Merge pull request #114 from xclaesse/prepare-for-meson
Prepare for meson
2018-12-06 16:05:03 +01:00
Xavier Claessens aff5cef20e tests: Do not hardcode psl.dafsa and psl_ascii.dafsa file names 2018-12-06 09:11:56 -05:00
Xavier Claessens 1653897a49 Rename suffixes_dafsa.c to suffixes_dafsa.h
It is a generated file that we #include, so it makes more sense to have
.h extension. Also Meson tries to compile that file if it has .c
extension.
2018-12-06 09:11:02 -05:00
Tim Rühsen 808dbaf1f1 Update PSL from upstream 2018-11-06 14:53:07 +01:00
Tim Rühsen 3687c2b97b Revert "Disable build without runtime for Travis"
This reverts commit b6fb9815f6.

Upstream accepted my patches :-)
2018-11-06 13:27:09 +01:00
Tim Rühsen 8fbe3f3130
Merge pull request #111 from rockdaboot/tmp-fix-travis-build
Disable build without runtime for Travis
2018-10-30 13:18:29 +01:00
Tim Rühsen b6fb9815f6 Disable build without runtime for Travis
When/If publicsuffix/list changes to NFC format, this commit
can be reverted.
2018-10-30 12:48:20 +01:00
Tim Rühsen a8b4b68959
Merge pull request #109 from rockdaboot/define-comply-c99
src/psl.c: Use C99 compliant defines
2018-10-29 15:27:45 +01:00
Tim Rühsen 9eedf5f246 Fix code broken by 2nd last patch 2018-10-29 14:56:27 +01:00
Tim Rühsen 1e1b9f5748 src/psl.c: Use C99 compliant defines 2018-10-29 13:17:59 +01:00
Tim Rühsen e21c174e86
Merge pull request #110 from rockdaboot/use-more-c99
Use more C99 compliant file-scope variables
2018-10-29 13:13:47 +01:00
Tim Rühsen 9dba7e4f4c Use more C99 compliant file-scope variables 2018-10-29 12:16:52 +01:00
Tim Rühsen 8ee5c0993f Fix some issues found by lgtm.com 2018-10-15 17:40:29 +02:00
Tim Rühsen 6938d1f513 Add .lgtm.yml 2018-10-15 17:29:23 +02:00
Tim Rühsen ab893d4e23 Rename _PSL_* macros to be POSIX compliant
Reported-by: Marc Lehmann
2018-10-14 20:24:45 +02:00
Tim Rühsen e87d463d04 Remove NLS / gettext from library code 2018-10-13 22:37:00 +02:00
Tim Rühsen e1104c58f3 Remove redundant code in _psl_is_public_suffix()
Reported-by: Marc Lehmann
2018-10-13 22:24:05 +02:00
Tim Rühsen 68b1b0c7e5 Change download link of the PSL 2018-10-13 22:01:36 +02:00
Tim Rühsen 85ccc92281 Change ML archive link 2018-10-13 21:57:41 +02:00
Tim Rühsen 9d064cace8 Update to latest Public Suffix List 2018-10-07 21:15:07 +02:00
Don 02648135c9 Use __has_declspec_attribute for shared builds
Clang compilation targets may support `__declspec` attributes. Because of that it has a `__has_declspec_attribute` [check](https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute).

Currently libpsl just assumes that `__declspec` is Windows only. This adds a compatibility macro and checks whether `dllimport` and `dllexport` are available.
2018-10-07 11:32:45 +02:00
Tim Rühsen a3bd08fbf2 Add script to build with MinGW 2018-10-05 20:49:21 +02:00
Tim Rühsen d691a3b941 Add Windows compatibility to fopen 2018-10-05 20:47:26 +02:00
Tim Rühsen 523397fb83 psl tool: Fix possible crashes with printf %s, NULL
Reported-by: Mike Schiffman
2018-07-04 09:37:25 +02:00
Tim Rühsen 4c68696eb1 Add -b/--batch to suppress printing the domain 2018-05-18 15:37:53 +02:00
Tim Rühsen b77d54469e Fix and cleanup build 2018-04-30 15:14:17 +02:00
Tim Rühsen b7f5c1414d Release V0.20.2 2018-04-26 20:18:39 +02:00
Tim Rühsen 3695113cf6 Add msvc/ autogen files to .gitignore 2018-04-26 19:27:15 +02:00
Tim Rühsen 5fd44f138b Fix several configure --enable options 2018-04-26 19:20:46 +02:00
Tim Rühsen a6397a0d62 Remove _HIDDEN from src/lookup_string_in_fixed_set.c 2018-04-26 16:45:15 +02:00
Tim Rühsen c93175c32d
Merge pull request #99 from fanc999/build.win
Add NMake Makefiles for Visual Studio builds
2018-04-26 10:46:50 +00:00
Chun-wei Fan 6a5da68ccf Add NMake Makefiles for Visual Studio builds
This adds a set of Visual Studio NMake Makefiles that can be used to
build libpsl, either as a DLL or as a static .lib.  Building of the psl
tool and the tests in tests/ (but not fuzz, since those tests use
fmemopen(), that is not supported on Windows) are also supported.

A simplified "install" target is provided that copies the build
results to a default or set prefix with the pkg-config file so that
other packages (such as libsoup) with build systems that depend on this
.pc file can be built.

These files make use of autotools stuff so that they have the up-to-date
version info upon a release.

Currently, only builds using the ICU runtime/builtin or with no
runtime/builtin are supported with Visual Studio builds.
2018-04-26 17:09:28 +08:00
Tim Rühsen 724fbd0098 Fix make distcheck 2018-04-25 17:06:44 +02:00
Tim Rühsen 7cb146765e Fix when built as a projects subdir 2018-04-25 16:50:42 +02:00
Tim Rühsen 1a59430862 Add LTLIBICONV and LTLIBINTL to libpsl build 2018-04-25 16:00:12 +02:00
Tim Rühsen 64db5a57da Add support for native Win32 builds 2018-04-25 15:56:00 +02:00
Tim Rühsen b220ffb0b9 Fix MinGW cros build on Linux 2018-04-21 11:30:22 +02:00
Tim Rühsen 8595ebb0ce Fix previous commit 2018-04-21 11:26:20 +02:00
Tim Rühsen 1a8e3e01f5 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-20 15:36:36 +02:00
Chun-wei Fan 5f85085d76 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-20 14:46:26 +02:00
Chun-wei Fan 9620b13374 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-20 14:46:02 +02:00
Tim Rühsen 44256b1a3a Make global vars static in test-is-public-all.c 2018-04-19 10:21:25 +02:00
Tim Rühsen 01b6cba78f Remove leading _ from header guard 2018-04-19 10:16:45 +02:00
Tim Rühsen c4a2698e22 Remove unused vars in test-is-public-all.c 2018-04-19 10:15:53 +02:00
Tim Rühsen 6244c731b9 Extend visibility support
Also renamed PSL_PUBLIC -> PSL_API (conforming to other known libraries).
2018-04-19 10:07:10 +02:00
Chun-wei Fan 8e91838fd5 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-19 09:37:57 +02:00
Chun-wei Fan 859b307593 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-19 09:37:37 +02:00
Tim Rühsen 84536ee21d
Merge pull request #96 from ebassi/non-srcdir-build
Fix non-srcdir builds
2018-04-06 18:22:59 +00:00
Emmanuele Bassi c9a550e93c 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-06 18:26:07 +01:00
Tim Rühsen 8aba48aa27
Merge pull request #94 from dkg/speling
fix spelling errors
2018-03-23 13:31:26 +00:00
Daniel Kahn Gillmor 2c66c15a99 fix spelling errors 2018-03-23 11:33:55 +00:00
Tim Rühsen fe2042fea8 Fix make distcheck without enabled docs 2018-03-06 10:21:45 +01:00
Tim Rühsen 32f3861216 Don't require xsltproc when not building man pages 2018-03-06 09:40:11 +01:00
Tim Rühsen f7e0d9441a Fix --disable-builtin configure option 2018-03-05 11:25:06 +01:00
Tim Rühsen 6220e02ebd Release V0.20.1 2018-02-26 11:47:27 +01:00
Tim Rühsen e0c1ed0e7a Improve docs for PSL_TYPE_NO_STAR_RULE 2018-02-26 11:45:57 +01:00
Tim Rühsen a9ccf7ab23 Add man page text about effect of --no-star-rule 2018-02-26 11:35:18 +01:00
Tim Rühsen 337e189979 Add --no-star-rule to psl utility 2018-02-26 11:23:01 +01:00
Tim Rühsen 35d96246e7 Release v0.20.1 2018-02-23 14:50:55 +01:00
Tim Rühsen 8fd480584e Fix PSL_TYPE_NO_STAR_RULE and improve test suite
Reported-by: Daniel Kahn Gillmor
2018-02-23 12:09:07 +01:00
Tim Rühsen 9542813a8f Release v0.20.0 2018-02-22 10:04:00 +01:00
Tim Rühsen 43ec750b40 Update copyrights 2018-02-22 10:04:00 +01:00
Tim Rühsen 2e15e597ca Update fuzzer to use PSL_TYPE_NO_STAR_RULE 2018-02-22 09:54:50 +01:00
Tim Rühsen 53326dc098 Update PSL submodule 2018-02-21 20:51:29 +01:00
Tim Rühsen aaacdae977 Add TLDs to (DAFSA) data to allow skipping the star rule 2018-02-21 20:49:26 +01:00
Claudio Saavedra 49707dc3b3 Add tests for PSL_TYPE_NO_STAR_RULE 2018-02-21 20:48:05 +01:00
Claudio Saavedra 9e9341f5b9 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-02-21 17:11:01 +02:00
Tim Rühsen 819486edd1 Remove C99 loop construct 2018-02-21 15:56:58 +01:00
Tim Rühsen 179ca703b2 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-02-13 15:42:17 +01:00
Dagobert Michelsen 27614b6b35 Remove unconditional setting of GCC-specific flag 2018-01-16 15:56:24 +01:00
Tim Rühsen f9f256dbcc Update PSL submodule 2018-01-16 15:32:12 +01:00
Jeffrey Walton 8b9f5c204d Expand defintion of PSL; add ICANN reference 2018-01-05 10:16:11 +01:00
Tim Rühsen 4491895e6c Add missing include alloca.h in fuzz/main.c 2017-11-11 15:18:37 +01:00
Tim Rühsen cb5933d981 Fix printf warnings in fuzz/main.c 2017-11-11 15:10:25 +01:00
Tim Rühsen 9bd2c6ad37 Release v0.19.1 2017-11-09 15:37:26 +01:00
287 changed files with 72557 additions and 1693 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
github: rockdaboot

53
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "49 4 * * 0"
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ python, cpp ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Packages (cpp)
if: ${{ matrix.language == 'cpp' }}
run: |
sudo apt-get update
sudo apt-get install --yes lzip autopoint
- name: Configure (cpp)
if: ${{ matrix.language == 'cpp' }}
run: ./autogen.sh && ./configure --disable-gtk-doc
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"

4
.gitignore vendored
View File

@ -57,6 +57,8 @@ libpsl.pc
libtool
ltmain.sh
m4/
msvc/config-msvc.mak
msvc/config.h.win32
Makefile
Makefile.in
missing
@ -77,7 +79,7 @@ po/remove-potcdate.sed
po/stamp-po
src/psl2c
src/suffixes.c
src/suffixes_dafsa.c
src/suffixes_dafsa.h
stamp-h1
test-driver
tests/*.log

7
.lgtm.yml Normal file
View File

@ -0,0 +1,7 @@
extraction:
cpp:
prepare:
packages:
- lzip
configure:
command: ./autogen.sh && ./configure --disable-gtk-doc

View File

@ -1,5 +1,5 @@
sudo: false
dist: trusty
dist: xenial
language: c
@ -38,8 +38,10 @@ addons:
- valgrind
script:
- set -e
- sed -i 's/dist-lzip//g' configure.ac
- ./autogen.sh
# CFI doesn't work out on Ubuntu 14.04 (Trusty). They dont't include LLVMgold.so for clang-3.8.
# CFI doesn't work out on Ubuntu 14.04 (Trusty). They don't include LLVMgold.so for clang-3.8.
# clang-3.4 doesn't know CFI yet.
# The only chance with Travis-CI is to switch to docker and use Ubuntu 16.04 or whatever.
# - if [[ $CC == "gcc" ]]; then CFI=""; else CFI="--enable-cfi"; fi

View File

@ -18,3 +18,7 @@ Giuseppe Scrivano
Ryan Sleevi (Discussion, Requested DAFSA format and ICANN/PRIVATE support)
Daurnimator (Code review, discussion, reports)
Olle Liljenzin (Original DAFSA implementation and UTF-8 patch)
Claudio Saveedra (Add support for PSL_TYPE_NO_STAR_RULE)
Chun-wei Fan (Add NMake files)
Xavier Claessens (Add Meson build system)
Ignacio Casal Quinteiro (Improve Meson build)

View File

@ -1,4 +1,4 @@
Copyright (C) 2014-2015 Tim Rühsen
Copyright (C) 2014-2022 Tim Rühsen
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -1,4 +1,4 @@
Copyright (C) 2014-2015 Tim Rühsen
Copyright (C) 2014-2022 Tim Rühsen
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -1,6 +1,14 @@
# got some hints from https://gitorious.org/openismus-playground/examplelib/source
SUBDIRS = po include src tools $(LIBPSL_DOCS) fuzz tests
SUBDIRS = po include src tools
if ENABLE_GTK_DOC
SUBDIRS += docs/libpsl
else
if ENABLE_MAN
SUBDIRS += docs/libpsl
endif
endif
SUBDIRS += fuzz tests msvc
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@ -14,7 +22,7 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpsl.pc
EXTRA_DIST = config.rpath LICENSE
EXTRA_DIST = build-aux/config.rpath LICENSE meson.build meson_options.txt
dist-hook:
mkdir -p $(distdir)/list/tests
cp -p $(PSL_FILE) $(distdir)/list

35
Makefile.os4 Normal file
View File

@ -0,0 +1,35 @@
USE_CLIB2=YES
ifeq ($(USE_CLIB2), YES)
LIBC=clib2
else
LIBC=newlib
endif
all: build
init:
# git submodule update --init
sh ./autogen.sh
autoreconf --install --force --symlink
build: init
CC="ppc-amigaos-gcc" CFLAGS="-mcrt=${LIBC} -fPIC" CXXFLAGS="-mcrt=${LIBC} -fPIC" LDFlags="-mcrt=${LIBC}" LIBS="-lpthread -athread=native" ./configure --host=ppc-amigaos --enable-shared=no --enable-builtin --disable-runtime && \
make -j$(shell nproc)
clean:
@make -f Makefile clean
@rm -rf autom4te.cache .deps
@rm config.log config.status configure libtool Makefile Makefile.in *.m4
release:
@mkdir -p release/local/common/include
@mkdir -p release/local/clib2/lib
# @mkdir -p release/local/newlib/lib
@make -f Makefile.os4 USE_CLIB2=YES
@cp ./src/.libs/libpsl.a ./src/.libs/libpsl.lai ./src/libpsl.la release/local/clib2/lib/
@cp ./include/libpsl.h release/local/common/include/
# @make -f Makefile.os4 clean
# @make -f Makefile.os4 USE_CLIB2=NO
# @cp ./src/.libs/libpsl.a ./src/.libs/libpsl.lai ./src/libpsl.la release/local/newlib/lib/
@lha -aeq libpsl.lha release/

57
NEWS
View File

@ -1,4 +1,59 @@
Copyright (C) 2014-2017 Tim Rühsen
Copyright (C) 2014-2022 Tim Rühsen
26.12.2022 Release V0.21.2
* Increased internal label size
* Meson build improvements (needs meson >= 0.60.0)
* Autoconf build improvements
* Add instructions on how to build from tarball
* Add WSAStartup() for Windows psl tool and tests
* Bump gettext version to 0.19.3
* Fix stack buffer overflow WRITE 1 in domain_to_punycode()
(Relevant only when built without any IDNA library.)
* Fix undefined behavior in library code
* Ensures that calls to fopen() and stat() can handle largefiles
* Several minor (non-functional) changes
18.07.2020 Release V0.21.1
* Fixing a test due to recent changes in upstream PSL
* Meson build improvements
* Documentation cleanups
* Use semantic versioning for git tags
16.04.2019 Release V0.21.0
* Add -b/--batch to 'psl' to suppress printing the domain
* Add support for Meson build system
* Improve build system
* Improve Windows compatibility
* Remove NLS / gettext
* Several cleanups and cosmetics
26.04.2018 Release V0.20.2
* Fix non srcdir builds
* Add API decoration
* Fix for MSVC/Win32 builds
* Detection fallback from libidn2 to libcu, libidn
* Fix MinGW cross builds on Linux
* Add NMake Makefiles for Visual Studio builds
26.02.2018 Release V0.20.1
* Fix issue introduced with PSL_TYPE_NO_STAR_RULE in V0.20.0
* Fix SO_VERSION to 8:0:3
* Improve unit tests
22.02.2018 Release V0.20.0
* Remove hard-coded gcc flag in Makefile.am
* Prevent excessive CPU cycles on large inputs
* New flag PSL_TYPE_NO_STAR_RULE to skip star rule
09.11.2017 Release V0.19.1
* Add the forgotten commit with NEWS and configure.ac
09.11.2017 Release V0.19.0
* New function psl_free_string()
* psl_make_dafsa now works with python2 and python3
* psl_*count() functions now return -1 if info is not available
* Fixed unsigned integer overflow in _mem_is_ascii()
* Add -fsanitize-address-use-after-scope to --enable-asan if available
20.07.2017 Release V0.18.0
* Fix order of files in psl_latest()

138
README.MSVC.md Normal file
View File

@ -0,0 +1,138 @@
Building libpsl with Visual Studio
==================================
Building libpsl for Windows using Visual Studio 2008 or later is
supported with NMake (from release tarballs) or Meson (from GIT
checkouts). The following sections will cover building libpsl with
these methods.
Currently, for builtin/runtime public suffix list (PSL) IDNA handling,
only ICU is supported for Visual Studio builds.
Using NMake (from a release tarball)
===========
You will need a Python 2.7.x or later installation in order to
complete the build successfully.
You will need the ICU (International Components for Unicode)
libraries, headers and DLLs, to build libpsl, unless both
DISABLE_BUILTIN=1 and DISABLE_RUNTIME=1 are passed into the NMake
command line as listed below.
You can also buid libpsl with libiconv and gettext support, please
see the options below for enabling such support.
In a Visual Studio command prompt which matches your desired
configuration (x86/Win32, x64 etc.),
go to $(srcroot)\msvc, and issue the following command:
nmake /f Makefile.vc CFG=[debug|release]
A 'test' target is provided to build the test programs, while a
'clean' target is provided to remove all the compiled and generated
files for the build. An 'install' target is provided to copy the
build PSL DLL, .lib and executables, as well as the related PDB files
and libpsl header, into appropriate locations under PREFIX (please see
below).
This will build the libpsl DLL/LIB and the psl.exe utility in the
vsX\$(CFG)\$(ARCH) subdirectory, where X is the release version
of Visual Studio, such as 9 for 2008 and 16 for 2019, and ARCH is
Win32 for 32-bit builds and x64 for 64-bit (x86_64) builds.
A number of options can be passed into the NMake command, as follows.
Enable by setting each option to 1, unless otherwise indicated:
* PSL_FILE: Location of the PSL data file, which is retrieved from
https://publicsuffix.org/list/public_suffix_list.dat,
or some other custom location (not supported). Default
is in $(srcroot)\list\public_suffix_list.dat. This is
needed to generate the suffixes_dafsa.h header required
for the build, as well as the binary and ascii dafsa
files used for the test programs.
* TEST_PSL_FILE: Location of the test PSL file. Default is in
$(srcroot)\list\tests\tests.txt. This is
required for building and running the test
programs.
* STATIC: Set if building static versions of libpsl is desired.
* USE_LIBTOOL_DLLNAME: Set to use libtool-style DLL naming.
* DISABLE_RUNTIME: Do not use ICU to generate runtime PSL data.
* DISABLE_BUILTIN: Do not use ICU to generate builtin PSL data.
* USE_ICONV: Enable libiconv support, requires libiconv.
* USE_GETTEXT: Enable gettext support for displaying i18n messages.
Implies USE_ICONV, and requires gettext-runtime.
* PYTHON: Full path to a Python 2.7.x (or later) interpreter, if not
already in your PATH.
Required to generate DAFSA headers and data files that is
needed for the build, as well as generating pkg-config
files for NMake builds.
* PREFIX: Base installation path of the build. Note that any dependent
libraries are searched first from the include\ and lib\
sub-directories in PREFIX before searching in the paths
specified by %INCLUDE% and %LIB%. Default is
$(srcroot)\..\vsX\$(PLATFORM), where X is the release version
of Visual Studio, such as 9 for 2008 and 16 for 2019,
$(PLATFORM) is the target platform (Win32/x64) of the build.
Building libpsl with Meson
==========================
Building using Meson is now supported for Visual Studio builds from a
GIT checkout.
Besides the requirements listed in the NMake builds, you will also need
* Python 3.5.x or later
* Meson build system, use PIP to install from Python 3.5.x64
* Ninja build tool (if not involking Meson with --backend=
vs[2010|2015|2017|2019])
* A compatible PSL data file and a test PSL data file. You may
consider using the ones shipped with the latest libpsl release
tarball and place the PSL data file in $(srcroot)/list and the
test PSL data file in $(srcroot)/list/tests. You may also choose
to download the latest PSL data file from
https://publicsuffix.org/list/public_suffix_list.dat and place it
it $(srcroot)/list. Alternatively, specify
-Dpsl_file=<path_to_psl_data_file> and/or
-Dpsl_testfile=<path_to_test_psl_data_file> when invoking Meson.
Open a Visual Studio command prompt and enter an empty build directory.
Your Python interpreter, Meson executable script and Ninja (if used)
need to be in your PATH.
Any dependent libraries that are being used should have their headers
found in paths specified by %INCLUDE% and their .lib files in the
paths specified by %LIB%.
In the empty build directory, run the following:
meson <path_to_libpsl_git_checkout> --buildtype=... --prefix=<some_prefix> [--backend=vs[2010|2015|2017|2019]]
Please see the Meson documentation for the values accepted by
--buildtype. --backend=vsXXXX generates the corresponding versions
of the Visual Studio solution files to build libpsl, which
will elimnate the need to have the Ninja build tool installed.
When the Meson configuration completes, run 'ninja' or open the
generated solution files with Visual Studio and build the projects
to carry out the build. Run 'ninja test' or the test project to
test the build and run 'ninja install' or 'ninja install' to
install the build results.
If building with Visual Studio 2008, run the following after running
'ninja install' in your builddir:
for /r %f in (*.dll.manifest) do if exist $(prefix)\bin\%~nf mt /manifest %f /outputresource:$(prefix)\bin\%~nf;2
for /r %f in (*.exe.manifest) do if exist $(prefix)\bin\%~nf mt /manifest %f /outputresource:$(prefix)\bin\%~nf;1
So that the application manifests get properly embedded.

View File

@ -11,9 +11,14 @@ Solaris OpenCSW [![Build Status Solaris amd64](https://buildfarm.opencsw.org/bui
libpsl - C library to handle the Public Suffix List
===================================================
A "public suffix" is a domain name under which Internet users can directly register own names.
A *Public Suffix List* is a collection of Top Level Domains (TLDs) suffixes.
TLDs include *Global Top Level Domains* (gTLDs) like `.com` and `.net`;
*Country Top Level Domains* (ccTLDs) like `.de` and `.cn`;
and *[Brand Top Level Domains](https://icannwiki.org/Brand_TLD)* like `.apple` and `.google`.
Brand TLDs allows users to register their own top level domain that exist at the same level as ICANN's gTLDs.
Brand TLDs are sometimes referred to as Vanity Domains.
Browsers and other web clients can use it to
Browsers, web clients and other user agents can use a public suffix list to:
- avoid privacy-leaking "supercookies"
- avoid privacy-leaking "super domain" certificates ([see post from Jeffry Walton](https://lists.gnu.org/archive/html/bug-wget/2014-03/msg00093.html))
@ -34,9 +39,9 @@ Libpsl...
Find more information about the Public Suffix List [here](https://publicsuffix.org/).
Download the Public Suffix List [here](https://hg.mozilla.org/mozilla-central/raw-file/tip/netwerk/dns/effective_tld_names.dat).
Download the Public Suffix List [here](https://github.com/publicsuffix/list/blob/master/public_suffix_list.dat).
The DAFSA code has been taken from [Chromium Project](https://code.google.com/p/chromium/).
The original DAFSA code is from the [Chromium Project](https://code.google.com/p/chromium/).
API Documentation
@ -101,6 +106,24 @@ See the LICENSE file that accompanies this distribution for the full text of the
src/psl-make-dafsa and src/lookup_string_in_fixed_set.c are licensed under the term written in
src/LICENSE.chromium.
Building from tarball
---------------------
Choose a release from https://github.com/rockdaboot/libpsl/tags an download the tarball
named `libpsl-{version}.tar.*`. Unpack with `tar xf <filename>`, cd into the libsl* directory.
Build with
```
./configure
make
make check
```
Install with
```
sudo make install
```
Building from git
-----------------
@ -114,11 +137,20 @@ Download project and prepare sources with
make
make check
If you prefer a `meson` build
meson builddir
ninja -C builddir
ninja -C builddir test
There is also an unofficial MSVC nmake build configuration in `msvc/`. Please
see README.MSVC.md on building libpsl with Visual Studio via NMake or Meson.
Mailing List
------------
[Mailing List Archive](http://news.gmane.org/gmane.network.dns.libpsl.bugs)
[Mailing List Archive](https://groups.google.com/forum/#!forum/libpsl-bugs)
[Mailing List](https://groups.google.com/forum/#!forum/libpsl-bugs)

View File

@ -1,7 +1,7 @@
AC_INIT([libpsl], [0.18.0], [tim.ruehsen@gmx.de], [libpsl], [https://github.com/rockdaboot/libpsl])
AC_INIT([libpsl],[m4_normalize(m4_include(version.txt))],[tim.ruehsen@gmx.de],[libpsl],[https://github.com/rockdaboot/libpsl])
AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 no-define foreign])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.10 no-define foreign dist-lzip])
# Generate two configuration headers; one for building the library itself with
# an autogenerated template, and a second one that will be installed alongside
@ -10,13 +10,18 @@ AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
#LT_INIT([disable-static])
LT_INIT
LT_INIT([win32-dll])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_SYS_LARGEFILE
dnl Check that compiler understands inline
AC_C_INLINE
dnl Check for visibility support
gl_VISIBILITY
#
# Generate version defines for include file
#
@ -30,7 +35,8 @@ AC_CONFIG_FILES([include/libpsl.h])
# Gettext
#
AM_GNU_GETTEXT([external],[need-ngettext])
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT_VERSION([0.19.3])
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.3])
#
# check for gtk-doc
@ -46,43 +52,42 @@ AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], false)
])
if test x"$have_gtk_doc" = xyes -a x"$enable_gtk_doc" = xyes; then
AC_CONFIG_FILES([docs/libpsl/Makefile docs/libpsl/version.xml])
AC_SUBST([LIBPSL_DOCS], [docs/libpsl])
fi
#
# enable creation of man pages
#
AC_ARG_ENABLE(man,[AC_HELP_STRING([--enable-man],
[generate man pages [default=auto]])],enable_man=yes,enable_man=no)
AS_IF([test "$enable_man" != no], [
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test -z "$XSLTPROC"], [
AS_IF([test "$enable_man" = yes], [
AC_MSG_ERROR([xsltproc is required for --enable-man])
])
enable_man=no
])
])
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
AC_MSG_CHECKING([whether to generate man pages])
AS_IF([ test "$enable_man" != no ], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
AC_ARG_ENABLE([man],
[AS_HELP_STRING([--enable-man], [generate man pages [default=auto]])],
[
if test "$enable_man" = yes; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test -z "$XSLTPROC"], [
AC_MSG_ERROR([xsltproc is required for --enable-man])
enable_man="no (xsltproc not found)"
])
fi
], [ enable_man=no ])
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man = xyes)
# src/psl-make-dafsa needs python 2.7+
AM_PATH_PYTHON([2.7])
PKG_PROG_PKG_CONFIG
cfi=no
AC_ARG_ENABLE([fuzzing],
[AS_HELP_STRING([--enable-fuzzing], [Turn on fuzzing build (for developers)])],
[enable_fuzzing=yes;
AC_SUBST([LIB_FUZZING_ENGINE])
AC_DEFINE([FUZZING], 1, [Define to 1 if this is a fuzzing build])
], [enable_fuzzing=no; LIB_FUZZING_ENGINE=""])
AM_CONDITIONAL([FUZZING], [test "$enable_fuzzing" = "yes"])
AC_ARG_ENABLE([cfi],
[AS_HELP_STRING([--enable-cfi], [Turn on clang's Control Flow Integrity (CFI)])],
[
if test "$enableval" = yes; then
cfi=yes
if test "$enable_cfi" = yes; then
CFLAGS=$CFLAGS" -B/usr/bin/gold -fsanitize=cfi -flto -fvisibility=default -fno-sanitize-trap=all"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([], [])
@ -90,30 +95,28 @@ AC_ARG_ENABLE([cfi],
AC_MSG_ERROR([clang 3.7+ and the 'gold' linker are required for --enable-cfi])
])
fi
])
], [ enable_cfi=no ])
ubsan=no
AC_ARG_ENABLE([ubsan],
[AS_HELP_STRING([--enable-ubsan], [Turn on Undefined Behavior Sanitizer (UBSan)])],
[
if test "$enableval" = yes; then
ubsan=yes
if test "$enable_ubsan" = yes; then
# Set basic UBSAN compiler flags. Add your own to CFLAGS.
CFLAGS=$CFLAGS" -fsanitize=undefined -fno-sanitize-recover=undefined"
fi
])
], [ enable_ubsan=no ])
asan=no
AC_ARG_ENABLE([asan],
[AS_HELP_STRING([--enable-asan], [Turn on Address Sanitizer (ASan)])],
[
if test "$enableval" = yes; then
asan=yes
if test "$enable_asan" = yes; then
# Set basic ASAN compiler flags. Add your own to CFLAGS.
CFLAGS=$CFLAGS" -fsanitize=address -fno-omit-frame-pointer"
AX_CHECK_COMPILE_FLAG([-fsanitize-address-use-after-scope], [CFLAGS="$CFLAGS -fsanitize-address-use-after-scope"])
fi
])
], [ enable_asan=no ])
# Define these substitions here to keep all version information in one place.
# Define these substitutions here to keep all version information in one place.
# For information on how to properly maintain the library version information,
# refer to the libtool manual, section "Updating library version information":
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
@ -124,10 +127,10 @@ AC_ARG_ENABLE([asan],
# 4. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
# 5. If any interfaces have been added since the last public release, then increment age.
# 6. If any existing interfaces have been removed or changed since the last public release, then set age to 0.
AC_SUBST([LIBPSL_SO_VERSION], [6:2:1])
AC_SUBST([LIBPSL_SO_VERSION], m4_normalize(m4_include([libtool_version_info.txt])))
AC_SUBST([LIBPSL_VERSION], $VERSION)
# Check for enable/disable builtin PSL data
# Check for enable/disable runtime PSL data
AC_ARG_ENABLE(runtime,
[
--enable-runtime[[=IDNA library]]
@ -153,29 +156,20 @@ AC_ARG_ENABLE(runtime,
fi
], [
# this is the default if neither --enable-runtime nor --disable-runtime were specified
enable_runtime=libidn2
AC_DEFINE([WITH_LIBIDN2], [1], [generate PSL data using libidn2])
enable_runtime=auto
])
# Check for enable/disable builtin PSL data
AC_ARG_ENABLE(builtin,
[
--enable-builtin[[=IDNA library]]
Specify the IDNA library used for built-in data generation:
libidn2 [[default]]: IDNA2008 library (also needs libunistring)
libicu: IDNA2008 UTS#46 library
libidn: IDNA2003 library (also needs libunistring)
--enable-builtin Generate built-in PSL data
--disable-builtin Do not generate built-in PSL data
], [
if test "$enableval" = "libidn2" -o "$enableval" = "yes"; then
enable_builtin=libidn2
AC_DEFINE([BUILTIN_GENERATOR_LIBIDN2], [1], [generate PSL data using libidn2])
elif test "$enableval" = "libicu"; then
enable_builtin=libicu
AC_DEFINE([BUILTIN_GENERATOR_LIBICU], [1], [generate PSL data using libicu])
elif test "$enableval" = "libidn"; then
enable_builtin=libidn
AC_DEFINE([BUILTIN_GENERATOR_LIBIDN], [1], [generate PSL data using libidn])
if test "$enableval" = "yes"; then
enable_builtin=yes
elif test "$enableval" = "libidn" -o "$enableval" = "libidn2" -o "$enableval" = "libicu"; then
AC_MSG_WARN([--enable-builtin=$enableval is deprecated, use --enable-builtin (enabled by default)])
enable_builtin=yes
elif test "$enableval" = "no"; then
enable_builtin=no
else
@ -183,17 +177,46 @@ AC_ARG_ENABLE(builtin,
fi
], [
# this is the default if neither --enable-builtin nor --disable-builtin were specified
enable_builtin=libidn2
AC_DEFINE([BUILTIN_GENERATOR_LIBIDN2], [1], [generate PSL data using libidn2])
enable_builtin=yes
])
if test "$enable_runtime" = "libicu" -o "$enable_builtin" = "libicu"; then
if test "$enable_builtin" = "yes"; then
AC_DEFINE([ENABLE_BUILTIN], [1], [Generate built-in PSL data])
fi
if test "$enable_runtime" = "libidn2" -o "$enable_runtime" = "auto"; then
# Check for libidn2
PKG_CHECK_MODULES([LIBIDN2], [libidn2], [
HAVE_LIBIDN2=yes
if test "$enable_runtime" = "libidn2" -o "$enable_runtime" = "auto"; then
LIBS="$LIBIDN2_LIBS $LIBS"
CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
fi
], [
AC_SEARCH_LIBS(idn2_lookup_u8, idn2, HAVE_LIBIDN2=yes,
[
if test "$enable_runtime" = "libidn2"; then
AC_MSG_ERROR(You requested libidn2 but it is not installed.)
fi
], -lunistring)
])
if test "x$HAVE_LIBIDN2" = "xyes"; then
if test "$enable_runtime" = "auto"; then
enable_runtime=libidn2
AC_DEFINE([WITH_LIBIDN2], [1], [generate PSL data using libidn2])
fi
fi
fi
if test "$enable_runtime" = "libicu" -o "$enable_runtime" = "auto"; then
# Check for libicu
# using pkg-config won't work on older systems like Ubuntu 12.04 LTS Server Edition 64bit
# using AC_SEARCH_LIBS also don't work since functions have the library version appended
PKG_CHECK_MODULES([LIBICU], [icu-uc], [
HAVE_LIBICU=yes
if test "$enable_runtime" = "libicu"; then
if test "$enable_runtime" = "libicu" -o "$enable_runtime" = "auto"; then
LIBS="$LIBICU_LIBS $LIBS"
CFLAGS="$LIBICU_CFLAGS $CFLAGS"
fi
], [
@ -205,44 +228,55 @@ if test "$enable_runtime" = "libicu" -o "$enable_builtin" = "libicu"; then
[[#include <unicode/ustring.h>]],
[[u_strToUTF8(NULL, 0, NULL, NULL, 0, NULL);]])],
[HAVE_LIBICU=yes; LIBICU_LIBS="-licuuc"; AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]); AC_MSG_ERROR(You requested libicu but it is not installed.)])
LIBS=$OLDLIBS
[ AC_MSG_RESULT([no]);
if test "$enable_runtime" = "libicu"; then
AC_MSG_ERROR(You requested libicu but it is not installed.)
fi
LIBS=$OLDLIBS
])
])
fi
if test "$enable_runtime" = "libidn2" -o "$enable_builtin" = "libidn2"; then
# Check for libidn2
PKG_CHECK_MODULES([LIBIDN2], [libidn2], [
HAVE_LIBIDN2=yes
if test "$enable_runtime" = "libidn2"; then
CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
if test "x$HAVE_LIBICU" = "xyes"; then
if test "$enable_runtime" = "auto"; then
enable_runtime=libicu
AC_DEFINE([WITH_LIBICU], [1], [generate PSL data using libicu])
fi
], [
OLDLIBS=$LIBS
AC_SEARCH_LIBS(idn2_lookup_u8, idn2, HAVE_LIBIDN2=yes, AC_MSG_ERROR(You requested libidn2 but it is not installed.), -lunistring)
LIBS=$OLDLIBS
])
fi
fi
if test "$enable_runtime" = "libidn" -o "$enable_builtin" = "libidn"; then
if test "$enable_runtime" = "libidn" -o "$enable_runtime" = "auto"; then
# Check for libidn
PKG_CHECK_MODULES([LIBIDN], [libidn], [
HAVE_LIBIDN2=yes
if test "$enable_runtime" = "libidn"; then
HAVE_LIBIDN=yes
if test "$enable_runtime" = "libidn" -o "$enable_runtime" = "auto"; then
LIBS="$LIBIDN_LIBS $LIBS"
CFLAGS="$LIBIDN_CFLAGS $CFLAGS"
fi
], [
OLDLIBS=$LIBS
AC_SEARCH_LIBS(idna_to_ascii_8z, idn, HAVE_LIBIDN=yes, AC_MSG_ERROR(You requested libidn but it is not installed.))
LIBS=$OLDLIBS
AC_SEARCH_LIBS(idna_to_ascii_8z, idn, HAVE_LIBIDN=yes,
[
if test "$enable_runtime" = "libidn"; then
AC_MSG_ERROR(You requested libidn but it is not installed.)
fi
])
])
if test "x$HAVE_LIBIDN" = "xyes"; then
if test "$enable_runtime" = "auto"; then
enable_runtime=libidn
AC_DEFINE([WITH_LIBIDN], [1], [generate PSL data using libidn])
fi
fi
fi
# last fallback is noruntime/nobuiltin
if test "$enable_runtime" = "auto"; then
enable_runtime=no
fi
if test "x$HAVE_LIBIDN2" = "xyes" -o "x$HAVE_LIBIDN" = "xyes"; then
# Check for libunistring, we need it for psl_str_to_utf8lower()
OLDLIBS=$LIBS
AC_SEARCH_LIBS(u8_tolower, unistring, HAVE_UNISTRING=yes, AC_MSG_ERROR(You requested libidn2|libidn but libunistring is not installed.))
LIBS=$OLDLIBS
fi
# AM_ICONV sets @LIBICONV@ and @LTLIBICONV@ for use in Makefile.am
@ -252,10 +286,7 @@ AM_ICONV
AM_CONDITIONAL([WITH_LIBICU], test "x$enable_runtime" = "xlibicu")
AM_CONDITIONAL([WITH_LIBIDN2], test "x$enable_runtime" = "xlibidn2")
AM_CONDITIONAL([WITH_LIBIDN], test "x$enable_runtime" = "xlibidn")
AM_CONDITIONAL([BUILTIN_GENERATOR_LIBICU], test "x$enable_builtin" = "xlibicu")
AM_CONDITIONAL([BUILTIN_GENERATOR_LIBIDN2], test "x$enable_builtin" = "xlibidn2")
AM_CONDITIONAL([BUILTIN_GENERATOR_LIBIDN], test "x$enable_builtin" = "xlibidn")
AM_CONDITIONAL([WITH_BUILTIN], test $enable_builtin = yes)
AM_CONDITIONAL([ENABLE_BUILTIN], test "x$enable_builtin" = "xyes")
# Solaris has socket in libsocket and inet_ntop in libnsl, but also needs libsocket, so the order is important here
AC_CHECK_LIB([socket], [socket], [NEEDS_SOCKET=yes], [])
@ -268,6 +299,19 @@ elif test -n "$NEEDS_SOCKET" ; then
LIBS="$LIBS -lsocket"
elif test -n "$NEEDS_NSL" ; then
LIBS="$LIBS -lnsl"
else
# Platform dependant options
case "${host_os}" in
# MinGW / Windows
*mingw*)
# Select Windows NT/2000 and later, for WSAStringToAddressW()
CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x500"
# Needed for network support
LIBS="$LIBS -lws2_32"
;;
*)
;;
esac
fi
# Check for clock_gettime() used for performance measurement
@ -295,26 +339,32 @@ fi
# Check for distribution-wide PSL file
AC_ARG_WITH(psl-distfile,
AC_HELP_STRING([--with-psl-distfile=[PATH]], [path to distribution-wide PSL file]),
AS_HELP_STRING([--with-psl-distfile=[PATH]], [path to distribution-wide PSL file]),
PSL_DISTFILE=$withval AC_SUBST(PSL_DISTFILE))
# Check for custom PSL file
AC_ARG_WITH(psl-file,
AC_HELP_STRING([--with-psl-file=[PATH]], [path to PSL file]),
AS_HELP_STRING([--with-psl-file=[PATH]], [path to PSL file]),
PSL_FILE=$withval,
PSL_FILE="\$(top_srcdir)/list/public_suffix_list.dat")
AC_SUBST(PSL_FILE)
# Check for custom PSL test file
AC_ARG_WITH(psl-testfile,
AC_HELP_STRING([--with-psl-testfile=[PATH]], [path to PSL test file]),
AS_HELP_STRING([--with-psl-testfile=[PATH]], [path to PSL test file]),
PSL_TESTFILE=$withval,
PSL_TESTFILE="\$(top_srcdir)/list/tests/tests.txt")
AC_SUBST(PSL_TESTFILE)
# check for alloca / alloca.h
AC_FUNC_ALLOCA
AC_CHECK_FUNCS([strndup clock_gettime])
AC_CHECK_FUNCS([strndup clock_gettime fmemopen nl_langinfo])
# check for dirent.h
AC_HEADER_DIRENT
# strings.h may not exist on WIN32
AC_CHECK_HEADERS([strings.h])
# Override the template file name of the generated .pc file, so that there
# is no need to rename the template file when the API version changes.
@ -325,7 +375,11 @@ AC_CONFIG_FILES([Makefile
po/Makefile.in
fuzz/Makefile
tests/Makefile
libpsl.pc:libpsl.pc.in])
docs/libpsl/Makefile docs/libpsl/version.xml
libpsl.pc:libpsl.pc.in
msvc/Makefile
msvc/config.h.win32
msvc/config-msvc.mak])
AC_OUTPUT
AC_MSG_NOTICE([Summary of build options:
@ -342,6 +396,9 @@ AC_MSG_NOTICE([Summary of build options:
PSL Dist File: ${PSL_DISTFILE}
PSL File: ${PSL_FILE}
PSL Test File: ${PSL_TESTFILE}
Sanitizers: UBSan $ubsan, ASan $asan, CFI $cfi
Sanitizers: UBSan $enable_ubsan, ASan $enable_asan, CFI $enable_cfi
Docs: $enable_gtk_doc
Man pages: $enable_man
Tests: ${TESTS_INFO}
Fuzzing build: $enable_fuzzing, $LIB_FUZZING_ENGINE
])

View File

@ -37,10 +37,10 @@ for CC in gcc clang; do
rm -f $CACHEFILE
for options in \
"--enable-runtime=libicu --enable-builtin=libicu" \
"--enable-runtime=libidn2 --enable-builtin=libidn2" \
"--enable-runtime=libidn --enable-builtin=libidn" \
"--disable-runtime --enable-builtin=libicu"; do
"--enable-runtime=libicu" \
"--enable-runtime=libidn2" \
"--enable-runtime=libidn" \
"--disable-runtime"; do
export DISTCHECK_CONFIGURE_FLAGS="-q -C --cache-file=$CACHEFILE $options"
if test "$CC" = "clang"; then
echo

69
contrib/check-hard-meson Executable file
View File

@ -0,0 +1,69 @@
#!/bin/sh
#
# Do some checking before 'git push'.
# Set a stricter bash mode
set -e
set -u
# We define _GNU_SOURCE to avoid warnings with missing prototypes.
# C89 does not know snprintf, strdup, strndup, popen, pclose
export CFLAGS="-std=gnu89 -pedantic -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
ASAN_FLAGS="-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope"
# measure time consumed and print it at the end of the script
START=$(date +%s.%N)
for CC in clang gcc; do
export CC
echo
echo "*** Testing with CC=$CC"
for options in \
"-Dbuiltin=libicu -Druntime=libicu" \
"-Dbuiltin=libidn2 -Druntime=libidn2" \
"-Dbuiltin=libidn -Druntime=libidn" \
"-Dbuiltin=no -Druntime=no"; do
# normal build+check+valgrind-check
echo
echo " *** $options"
rm -rf builddir
meson builddir $options
cd builddir
ninja
for xLCALL in C tr_TR.utf8; do
LC_ALL=$xLCALL meson test
LC_ALL=$xLCALL meson test --wrap='valgrind --tool=memcheck'
done
cd ..
# UBSAN build+check
flags="-Db_sanitize=undefined -Db_lundef=false"
echo
echo " *** $options $flags"
rm -rf builddir
LDFLAGS="-lubsan" meson builddir $options $flags
LDFLAGS="-lubsan" ninja -C builddir
for xLCALL in C tr_TR.utf8; do
LC_ALL=$xLCALL ninja test -C builddir
done
# ASAN build+check
flags="-Db_sanitize=address -Db_lundef=false"
echo
echo " *** $options $flags"
rm -rf builddir
CFLAGS="$CFLAGS $ASAN_FLAGS" meson builddir $options $flags
CFLAGS="$CFLAGS $ASAN_FLAGS" ninja -C builddir
for xLCALL in C tr_TR.utf8; do
LC_ALL=$xLCALL CFLAGS="$CFLAGS $ASAN_FLAGS" ninja test -C builddir
done
done
done
END=$(date +%s.%N)
echo
echo "Duration: "$(echo "$END - $START" | bc)

57
contrib/mingw Executable file
View File

@ -0,0 +1,57 @@
#!/bin/bash
set -e
# just in case...
unset CC
unset CXX
#PREFIX=i686-w64-mingw32
PREFIX=x86_64-w64-mingw32
#export PATH="/usr/$PREFIX/bin:$PATH"
export INSTALLDIR="$PWD/$PREFIX"
export PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig:/usr/$PREFIX/lib/pkgconfig
export CPPFLAGS="-I$INSTALLDIR/include"
export LDFLAGS="-L$INSTALLDIR/lib"
# let mingw compiler be less verbose
export CFLAGS="-O2 -Wall -Wno-format"
# build libunistring
if [ ! -d libunistring ]; then
git clone https://git.savannah.gnu.org/git/libunistring.git
cd libunistring
else
cd libunistring
git pull
fi
./autogen.sh
./configure --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared --prefix=$INSTALLDIR
make clean
make -j$(nproc)
make install
cd ..
# build libidn2
if [ ! -d libidn2 ]; then
git clone https://gitlab.com/libidn/libidn2.git
cd libidn2
else
cd libidn2
git pull
fi
./bootstrap
./configure --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared --disable-doc --disable-gcc-warnings --prefix=$INSTALLDIR
make clean
make -j$(nproc)
make install
cd ..
# build libpsl
export WINEPATH="$INSTALLDIR/bin;$INSTALLDIR/lib;/usr/$PREFIX/bin;/usr/$PREFIX/lib;$PWD/libpsl/.libs;$GCCLIB"
./autogen.sh
./configure --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared --disable-gtk-doc --enable-runtime=libidn2 --prefix=$INSTALLDIR
make clean
make -j$(nproc)
make check -j$(nproc) LOG_COMPILER=wine

9
contrib/spell-checker Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env sh
#
# see https://github.com/codespell-project/codespell
#
# in short:
# - pip install codespell
# - add ~/.local/bin to PATH
codespell $* -L "tim" `git ls-files|egrep -v '_fuzzer.in|_fuzzer.repro|^list$'`

View File

@ -68,7 +68,7 @@ HTML_IMAGES=
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files=
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
# SGML files where gtk-doc abbreviations (#GtkWidget) are expanded
# These files must be listed here *and* in content_files
# e.g. expand_content_files=running.sgml
expand_content_files=
@ -86,7 +86,7 @@ include $(top_srcdir)/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
EXTRA_DIST +=
EXTRA_DIST += meson.build
# Files not to distribute
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types

View File

@ -22,10 +22,6 @@
</para>
<xi:include href="xml/libpsl.xml"/>
</chapter>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
@ -34,6 +30,35 @@
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<index role="0.1">
<title>Index of symbols included in 0.1</title>
<xi:include href="xml/api-index-0.1.xml"><xi:fallback/></xi:include>
</index>
<index role="0.2.5">
<title>New symbols included in 0.2.5</title>
<xi:include href="xml/api-index-0.2.5.xml"><xi:fallback/></xi:include>
</index>
<index role="0.4">
<title>New symbols included in 0.4</title>
<xi:include href="xml/api-index-0.4.xml"><xi:fallback/></xi:include>
</index>
<index role="0.10.0">
<title>New symbols included in 0.10.0</title>
<xi:include href="xml/api-index-0.10.0.xml"><xi:fallback/></xi:include>
</index>
<index role="0.11.0">
<title>Index of symbols included in 0.11.0</title>
<xi:include href="xml/api-index-0.11.0.xml"><xi:fallback/></xi:include>
</index>
<index role="0.16">
<title>Index of symbols included in 0.16</title>
<xi:include href="xml/api-index-0.16.xml"><xi:fallback/></xi:include>
</index>
<index role="0.19">
<title>Index of symbols included in 0.19</title>
<xi:include href="xml/api-index-0.19.xml"><xi:fallback/></xi:include>
</index>
<!--
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>

View File

@ -1,6 +1,7 @@
<SECTION>
<FILE>libpsl</FILE>
<TITLE>Public Suffix List functions</TITLE>
PSL_API
PSL_VERSION
PSL_VERSION_MAJOR
PSL_VERSION_MINOR
@ -8,6 +9,7 @@ PSL_VERSION_NUMBER
PSL_VERSION_PATCH
PSL_TYPE_ICANN
PSL_TYPE_PRIVATE
PSL_TYPE_NO_STAR_RULE
PSL_TYPE_ANY
psl_error_t
psl_ctx_t

20
docs/libpsl/meson.build Normal file
View File

@ -0,0 +1,20 @@
gnome = import('gnome')
if get_option('docs')
configure_file(
input : 'version.xml.in',
output : 'version.xml',
configuration : cdata)
gnome.gtkdoc('libpsl',
main_sgml: 'libpsl-docs.sgml',
src_dir: [
'src',
'include',
],
dependencies: libpsl,
scan_args: [
'--ignore-decorators=G_GNUC_PSL_UNUSED',
],
install: true)
endif

View File

@ -1,15 +1,18 @@
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) -Wno-unused-parameter
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(srcdir) -DSRCDIR=\"$(abs_srcdir)\" -DTEST_RUN
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(srcdir) -DSRCDIR=\"$(abs_srcdir)\"
#AM_LDFLAGS = -static
AM_LDFLAGS = -no-install
LDADD = ../src/libpsl.la $(LIBICU_LIBS) $(LIBIDN_LIBS) $(LIBIDN2_LIBS)
if !FUZZING
MAIN = main.c fuzzer.h
endif
if WITH_LIBICU
XLIBS = $(LIBICU_LIBS)
XTYPE = _icu
libpsl_icu_fuzzer_SOURCES = libpsl_fuzzer.c main.c fuzzer.h
libpsl_icu_load_fuzzer_SOURCES = libpsl_load_fuzzer.c main.c fuzzer.h
libpsl_icu_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c main.c fuzzer.h
libpsl_icu_fuzzer_SOURCES = libpsl_fuzzer.c $(MAIN)
libpsl_icu_load_fuzzer_SOURCES = libpsl_load_fuzzer.c $(MAIN)
libpsl_icu_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c $(MAIN)
PSL_TESTS = \
libpsl_icu_fuzzer$(EXEEXT) \
libpsl_icu_load_fuzzer$(EXEEXT) \
@ -18,9 +21,9 @@ else
if WITH_LIBIDN2
XLIBS = -lidn2 -lunistring
XTYPE = _idn2
libpsl_idn2_fuzzer_SOURCES = libpsl_fuzzer.c main.c fuzzer.h
libpsl_idn2_load_fuzzer_SOURCES = libpsl_load_fuzzer.c main.c fuzzer.h
libpsl_idn2_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c main.c fuzzer.h
libpsl_idn2_fuzzer_SOURCES = libpsl_fuzzer.c $(MAIN)
libpsl_idn2_load_fuzzer_SOURCES = libpsl_load_fuzzer.c $(MAIN)
libpsl_idn2_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c $(MAIN)
PSL_TESTS = \
libpsl_idn2_fuzzer$(EXEEXT) \
libpsl_idn2_load_fuzzer$(EXEEXT) \
@ -29,9 +32,9 @@ else
if WITH_LIBIDN
XLIBS = -lidn -lunistring
XTYPE = _idn
libpsl_idn_fuzzer_SOURCES = libpsl_fuzzer.c main.c fuzzer.h
libpsl_idn_load_fuzzer_SOURCES = libpsl_load_fuzzer.c main.c fuzzer.h
libpsl_idn_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c main.c fuzzer.h
libpsl_idn_fuzzer_SOURCES = libpsl_fuzzer.c $(MAIN)
libpsl_idn_load_fuzzer_SOURCES = libpsl_load_fuzzer.c $(MAIN)
libpsl_idn_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c $(MAIN)
PSL_TESTS = \
libpsl_idn_fuzzer$(EXEEXT) \
libpsl_idn_load_fuzzer$(EXEEXT) \
@ -39,9 +42,9 @@ if WITH_LIBIDN
else
XLIBS =
XTYPE =
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
libpsl_fuzzer_SOURCES = libpsl_fuzzer.c $(MAIN)
libpsl_load_fuzzer_SOURCES = libpsl_load_fuzzer.c $(MAIN)
libpsl_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c $(MAIN)
PSL_TESTS = \
libpsl_fuzzer$(EXEEXT) \
libpsl_load_fuzzer$(EXEEXT) \
@ -50,7 +53,18 @@ endif
endif
endif
check_PROGRAMS = $(PSL_TESTS)
if FUZZING
bin_PROGRAMS = $(PSL_TESTS)
LDADD += $(LIB_FUZZING_ENGINE)
AM_LDFLAGS = -no-install
else
AM_CPPFLAGS += -DTEST_RUN
AM_TESTS_ENVIRONMENT = export VALGRIND_TESTS"=@VALGRIND_TESTS@";
TESTS = $(PSL_TESTS)
check_PROGRAMS = $(PSL_TESTS)
endif
EXTRA_DIST = meson.build
dist-hook:
find . -name '*.options' -exec cp -v '{}' $(distdir) ';'
@ -59,7 +73,6 @@ dist-hook:
find . -name '*.repro' -exec cp -vr '{}' $(distdir) ';'
TESTS_ENVIRONMENT = TESTS_VALGRIND="@VALGRIND_ENVIRONMENT@"
TESTS = $(PSL_TESTS)
clean-local:
rm -rf *.gc?? *.log lcov coverage.info *_fuzzer *.o
@ -67,7 +80,7 @@ clean-local:
fuzz-coverage: $(PSL_TESTS)
find . -name '*_fuzzer' -exec ./coverage.sh '{}' ';'
CXX ?= clang-5.0
CXX ?= clang
CXXFLAGS ?= $(CFLAGS)
oss-fuzz:

View File

@ -12,24 +12,58 @@ regression testing with top dir 'make check' or 'make check-valgrind'.
The ./configure runs below are for libidn2.
To test libicu replace 'libidn2' with 'libicu', to test with
libidn replace 'libidn2' by 'libidn'.
To test without IDNA libraries replace `--enable-runtime=...` with `--disable-runtime`
and replace `--enable-builtin=...` with `--disable-builtin`.
# Running a fuzzer using clang
Use the following commands on top dir:
```
export CC=clang-5.0
export CFLAGS="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp"
./configure --enable-static --disable-gtk-doc --enable-runtime=libidn2 --enable-builtin=libidn2
make clean
export CC=clang
export LIB_FUZZING_ENGINE="-lFuzzer -lstdc++"
export UBSAN_OPTIONS=print_stacktrace=1
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
# set flags for clang asan
CFLAGS="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address,leak,nonnull-attribute -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp"
# set flags for clang ubsan
CFLAGS="$CFLAGS -fsanitize=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,vla-bound,vptr,undefined,alignment,null,enum,integer,builtin,float-divide-by-zero,function,object-size,returns-nonnull-attribute,unsigned-integer-overflow,unreachable -fsanitize=fuzzer-no-link"
# unsigned-integer-overflow is not UB, so recover when we see it.
CFLAGS="$CFLAGS -fno-sanitize-recover=all -fsanitize-recover=unsigned-integer-overflow"
export CFLAGS
./configure --enable-static --disable-gtk-doc --enable-fuzzing --enable-runtime=libidn2 --enable-builtin=libidn2
make -j$(nproc)
cd fuzz
# build and run libpsl_fuzzer
# run libpsl_fuzzer
./run-clang.sh libpsl_fuzzer
```
If you see a crash, then a crash corpora is written that can be used for further
investigation. E.g.
```
==2410==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000004e90 at pc 0x00000049cf9c bp 0x7fffb5543f70 sp 0x7ff
fb5543720
...
Test unit written to ./crash-adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
```
To reproduce the crash:
```
./libpsl_fuzzer < ./crash-adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
```
You can also copy/move that file into libpsl_fuzzer.repro/
and re-build the project without fuzzing for a valgrind run, if you like that better.
Just a `./configure` and a `make check-valgrind` should reproduce it.
# Running a fuzzer using AFL
Use the following commands on top dir:
@ -67,7 +101,7 @@ directory.
# Clang CFI instrumentation
```
CC=clang-5.0 CFLAGS="-B/usr/bin/gold -O0 -fsanitize=cfi -flto -fvisibility=default -fno-sanitize-trap=all" ./configure
CC=clang CFLAGS="-B/usr/bin/gold -O0 -fsanitize=cfi -flto -fvisibility=default -fno-sanitize-trap=all" ./configure
make clean
make
make check

View File

@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Tim Ruehsen
* Copyright(c) 2017-2022 Tim Ruehsen
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -22,8 +22,15 @@
* This file is part of libpsl.
*/
#include <config.h>
#include <stddef.h> /* size_t */
#ifdef HAVE_STDINT_H
#include <stdint.h> /* uint8_t */
#elif defined (_MSC_VER)
typedef unsigned __int8 uint8_t;
#endif
#ifdef __cplusplus
extern "C"

View File

@ -1,15 +1,8 @@
#!/bin/sh -eu
# First step: In the top directory execute
# export CC=clang-5.0
# export CFLAGS="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp"
# ./configure --enable-static --disable-gtk-doc --enable-runtime=libidn2 --enable-builtin=libidn2
# make clean
# make -j$(nproc) LIB_FUZZING_ENGINE="-lFuzzer"
# cd fuzz
# make -j$(nproc) check
# As a first step see README.md and follow the steps under "Running a fuzzer using clang".
#
# You might need 'gsutil' to download new corpora from the Google cloud:
# Read the docs at https://github.com/google/oss-fuzz/blob/master/docs/corpora.md
# then install 'google-cloud-sdk' and execute 'gcloud init'.
# Now 'gsutil' should be ready to use.
@ -20,13 +13,20 @@ if test -z "$1"; then
exit 1
fi
if ! grep -q FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION Makefile; then
echo "The fuzzers haven't been built for fuzzing (maybe for regression testing !?)"
echo "Please built regarding README.md and try again."
exit 1
fi
fuzzer=$1
project=$(echo $1 | cut -d'_' -f1)
# sync/copy the OSS-Fuzz corpora into the .new directory
mkdir -p ${fuzzer}.new
cp -p ${fuzzer}.in/* ${fuzzer}.new
gsutil -m rsync gs://${project}-corpus.clusterfuzz-external.appspot.com/libFuzzer/${fuzzer} ${fuzzer}.new
mkdir -p ${fuzzer}.in ${fuzzer}.new
cp -fp ${fuzzer}.in/* ${fuzzer}.new 2>/dev/null || true
gsutil cp $(gsutil ls gs://${project}-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/${fuzzer}|tail -n 1) ${fuzzer}.new/
(cd ${fuzzer}.new && unzip -o *.zip && mv *.zip ..)
# create fuzzer target
BUILD_ONLY=1 ./run-clang.sh ${fuzzer}
@ -35,8 +35,9 @@ BUILD_ONLY=1 ./run-clang.sh ${fuzzer}
./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new
# now clear .new dir and put all corpora there
rm -f ${fuzzer}.new/*
mv ${fuzzer}.in/* ${fuzzer}.new
rm -rf ${fuzzer}.new
mv ${fuzzer}.in ${fuzzer}.new
mkdir ${fuzzer}.in
# now merge again (optimizes number of corpora)
./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new

View File

@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Tim Ruehsen
* Copyright(c) 2017-2022 Tim Ruehsen
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -25,7 +25,13 @@
#include <config.h>
#include <assert.h> /* assert */
#ifdef HAVE_STDINT_H
#include <stdint.h> /* uint8_t */
#elif defined (_MSC_VER)
typedef unsigned __int8 uint8_t;
#endif
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
@ -40,9 +46,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
static int first_run = 1;
psl_ctx_t *psl;
char *domain = (char *) malloc(size + 1), *res;
char *domain, *res;
int rc;
if (size > 64 * 1024 - 1)
return 0;
domain = (char *) malloc(size + 1);
assert(domain != NULL);
/* 0 terminate */
@ -54,6 +64,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
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_public_suffix2(psl, domain, PSL_TYPE_NO_STAR_RULE);
psl_is_public_suffix2(psl, domain, PSL_TYPE_NO_STAR_RULE|PSL_TYPE_ANY);
psl_unregistrable_domain(psl, domain);
psl_registrable_domain(psl, domain);

View File

@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Tim Ruehsen
* Copyright(c) 2017-2022 Tim Ruehsen
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -25,15 +25,23 @@
#include <config.h>
#include <assert.h> /* assert */
#ifdef HAVE_STDINT_H
#include <stdint.h> /* uint8_t */
#elif defined (_MSC_VER)
typedef unsigned __int8 uint8_t;
#endif
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
#include <stdio.h> /* fmemopen */
#include "libpsl.h"
#include "fuzzer.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
#ifdef HAVE_FMEMOPEN
FILE *fp;
psl_ctx_t *psl;
char *in = (char *) malloc(size + 16);
@ -62,6 +70,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
psl_free(psl);
free(in);
#endif
return 0;
}

View File

@ -0,0 +1 @@
coííý

View File

@ -0,0 +1 @@
<EFBFBD>xn--tda.cí

View File

@ -0,0 +1 @@
<EFBFBD>€<EFBFBD>@

View File

@ -1 +0,0 @@
* ˙˙G¸¸GaguchéŔDň„uzz˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙o.iôŔ´o.đ˙˙˙˙˙˙aido.

View File

@ -1 +0,0 @@
agucguchéaguchéÀa

View File

@ -0,0 +1 @@
<02>c<EFBFBD>mx<6D>

View File

@ -0,0 +1 @@
<02>c<EFBFBD>mx<6D>-<2D>

View File

@ -0,0 +1 @@
<01>CC

View File

@ -1 +0,0 @@
;agucnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnhà;Dö„uzzo.iôÀ´

View File

@ -0,0 +1 @@
Γ<>ό<EFBFBD>®<EFBFBD>γ<EFBFBD>ο<EFBFBD>ν

View File

@ -0,0 +1 @@
<02>C|.c

View File

@ -0,0 +1 @@
<02>xn--tδγοαν

View File

@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Tim Ruehsen
* Copyright(c) 2017-2022 Tim Ruehsen
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -25,15 +25,23 @@
#include <config.h>
#include <assert.h> /* assert */
#ifdef HAVE_STDINT_H
#include <stdint.h> /* uint8_t */
#elif defined (_MSC_VER)
typedef unsigned __int8 uint8_t;
#endif
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
#include <stdio.h> /* fmemopen */
#include "libpsl.h"
#include "fuzzer.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
#ifdef HAVE_FMEMOPEN
FILE *fp;
psl_ctx_t *psl;
@ -50,6 +58,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
fclose(fp);
psl_load_file("/dev/null");
#endif
return 0;
}

View File

@ -1,38 +0,0 @@
.
иИ.3
иИ.
аИ.
кИ.кИ.
иИ.
иИ..
иИ.5
иИ.
аИ.
кИ.кИ
.иИ.
и.
иИ.И.
иИ.3
иИ.
а<EFBFBD>.
кИ.
иИ.
иИ.
иИ.
иИ.
иИ
иИ.
иИ.
и.3
иИ.
аИ.
кИ.
иМ.
аИ.
кИ.
иИ.
И.
иИ.
иИ.
иИ.
иИ.

View File

@ -0,0 +1,32 @@
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E><>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ļ.󠁸ü.Ȼ+.ü*..<2E>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ%.ü*.k
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E><>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.k
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.<2E><><EFBFBD><EFBFBD>ü.Ȼ+.ü*..<2E>
Ƽ.˸.ļ.˸.Ǽ.˸@.õ.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E><>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.k
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ%.ü*..ük
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.k
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˼.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E><>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.õ.˸.ü.ȹ.ü.󠁸ü.Ȼﴅ.ü*..<2E>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.k
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˼.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˼.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˼.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.õ.˸.ü.ȹ.ü.󠁸ü.Ȼﴅ.ü*..<2E>k
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.k
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E>.
Ƽ.˸.Ƽ.˸.Ǽ.˸@.õ.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ%.ü*..˸k
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.k
Ƽ.ɸ.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.Ӽ*..
Ƽ.˸.Ƽ.˸.Ǽ.˸@.ü.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*..<2E>
Ƽ.˸.Ƽ.˸.Ǽ.˸@.õ.˸.ü.ȹ.ü.󠁸ü.Ȼ+.ü*.+.<2E>

View File

@ -0,0 +1,33 @@
(!
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѼw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/<
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷw/=
公.cƼ.˸.Ƽ.˯.ļA.˸.ü.ü.ȼ公司.cn...ü.˸.ü(!wѷw//
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ公变#n...ü.˰.ü(#wѷw/A
公.cƼ.˸.Ƽ.˨.ļA.˸.ü.ü.ȼ僬司cn...ü.˸.ü(!wѷwa=

View File

@ -0,0 +1,31 @@
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===
//===END PRIVATE DOMAINS===
//===BEGIN PRIVATE DOMAINS===

View File

@ -0,0 +1,8 @@
Мё.Гј.Гј.Иј.Иј.Гј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЕЅ.Мё=..ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.ГјИј.Гј.Лё.Гј.Гј.ИЅ.ЖЅ.М

View File

@ -1,3 +0,0 @@
.å…¬å<C2AC>¸.cn_¯¸s;
!city.ka*.*.kawa!ü.comppÿÿÿÿÿÿÿÿÿÿÿÿÿ// ===END ICANN DOMAINS===asaki.jpwå.j
<EFBFBD>¸.pp!ÿpšppi

View File

@ -0,0 +1,16 @@
Мё.Гј.Гј.Иј.Иј.Гј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.ЖЅ.Мё=ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ГЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
Гј.ГјИј.Гј.Лј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..Вј.ј
В¬Дј.Лё.Гј.Гј.Лј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И»..ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ГЅ.И».Гј.ј
+В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.Вј.ИЅ.ЖЅ.Мё=..ВЅ.И».Гј.ј
В¬.Жј.Лё.Жј.ЛЁ.Дј.Лё.Гј.ГјИј.Гј.Лё.Гј.Гј.ИЅ.ЖЅ.М

View File

@ -1,26 +0,0 @@
pã.p
ã.p
å….jp
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
ã.p
pãp.ã
.
ã.p
ã.p
.p
ã.p
ã.p
ã.p
ã

View File

@ -1,6 +0,0 @@
.DAFSA@PSL_¯¸s;
™.jp
p*.pi
..jp
<EFBFBD>.
¸kp.Ÿšppi

Some files were not shown because too many files have changed in this diff Show More