summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-06-24Fix handling of empty strings when creating XML/HTML output.Steffen Kieß
2020-06-22Re-add `--safe` command-line option as a no-op.John MacFarlane
See #344.
2020-06-21Adjust the MinGW paths for MinGW64.Daniil Baturin
2020-05-13Don't call memcpy with NULL as 1st parameter.John MacFarlane
This is illegal according to the C standard, sec. 7.1.4. "If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or a pointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined." 7.24.1(2): "Where an argument declared as size_t n specifies the length of the array for a function, n can have the value zero […] pointer arguments on such a call shall still have valid values, as described in 7.1.4." See https://www.imperialviolet.org/2016/06/26/nonnull.html
2020-05-13Add more NOLINTNEXTLINE directives.John MacFarlane
2020-05-13Add NOLINTNEXTLINE to avoid a useless linter error.John MacFarlane
2020-05-13Add needed include in blocks.cJohn MacFarlane
2020-05-13Comment out unused function cmark_strbuf_cstr in buffer.hJohn MacFarlane
2020-05-13CI: Run linter.John MacFarlane
2020-05-13Add lint target to MakefileJohn MacFarlane
2020-05-13Fix unnecessary variable assignment.John MacFarlane
2020-05-13New lint target using clang-tidy.John MacFarlane
2020-05-13CI: Another attempt to add clang-tidy.John MacFarlane
2020-05-13Remove appveyor build.John MacFarlane
2020-05-13CI: change shared to cmark_opts in matrix, add linter.John MacFarlane
2020-05-13CI: test with different shared library configs.John MacFarlane
2020-05-13CI: try setting CPP in matrix.John MacFarlane
2020-05-13Fix syntax for matrix.John MacFarlane
2020-05-13Linux CI: use both gcc and clang.John MacFarlane
2020-05-13Add .gitattributes to ensure that line endings are normalized.John MacFarlane
2020-05-12Windows CI: ensure UTF-8.John MacFarlane
2020-05-12Revert "spec_tests.py: ignore line endings on diff."John MacFarlane
This reverts commit 54c990d17385156958556d86feca0c6e24da94e7.
2020-05-12spec_tests.py: ignore line endings on diff.John MacFarlane
2020-05-12Revert "spec_tests.py: don't keep line endings (for windows CI)."John MacFarlane
This reverts commit abc45c57d368383eb05ca5fbb79d33b0370b419c.
2020-05-12spec_tests.py: don't keep line endings (for windows CI).John MacFarlane
2020-05-12Add CI badge.John MacFarlane
2020-05-12Windows CI: try installing msvc tools.John MacFarlane
2020-05-12Revert "Revert "CI: avoid using nmake.bat.""John MacFarlane
This reverts commit 745b877835fed47e06daa3295aaf86312867f6f1.
2020-05-12Windows CI: specify cmd shell.John MacFarlane
2020-05-12Revert "CI: avoid using nmake.bat."John MacFarlane
This reverts commit c5732b26bb4d98cbec9de48cefad480cb880eb45.
2020-05-12CI: avoid using nmake.bat.John MacFarlane
2020-05-12CI: install valgrind for linux.John MacFarlane
2020-05-12Fix CI.John MacFarlane
2020-05-12Diagnostic for CI.John MacFarlane
2020-05-12Revert "Setup python."John MacFarlane
This reverts commit 9f760cefdee9dbc18e6294d78d139b629062fad7.
2020-05-12Setup python.John MacFarlane
2020-05-12Add GitHub actions CI.John MacFarlane
2020-05-12Update to Unicode 13.0data-man
2020-03-20Add uninstall target to Makefile.John MacFarlane
2020-03-19Adding CIFuzzLeo Neat
2020-03-03Skip UTF-8 BOM if present at beginning of buffer.John MacFarlane
Closes #334.
2020-02-16Add casts for MSVC10.John MacFarlane
This is kivikakk's commit 62166fe3b6b07068ed4c4207113e3c4b060ad4a8 in cmark-gfm.
2020-02-16Fix #220 (hash collisions for references).John MacFarlane
This commit ports Vicent Marti's fix in cmark-gfm. (384cc9db4cd7a90f59c0751e58eb7b3023d38b85) His commit message follows: As explained on the previous commit, it is trivial to DoS the CMark parser by generating a document where all the link reference names hash to the same bucket in the hash table. This will cause the lookup process for each reference to take linear time on the amount of references in the document, and with enough link references to lookup, the end result is a pathological O(N^2) that causes medium-sized documents to finish parsing in 5+ minutes. To avoid this issue, we propose the present commit. Based on the fact that all reference lookup/resolution in a Markdown document is always performed as a last step during the parse process, we've reimplemented reference storage as follows: 1. New references are always inserted at the end of a linked list. This is an O(1) operation, and does not check whether an existing (duplicate) reference with the same label already exists in the document. 2. Upon the first call to `cmark_reference_lookup` (when it is expected that no further references will be added to the reference map), the linked list of references is written into a fixed-size array. 3. The fixed size array can then be efficiently sorted in-place in O(n log n). This operation only happens once. We perform this sort in a _stable_ manner to ensure that the earliest link reference in the document always has preference, as the spec dictates. To accomplish this, every reference is tagged with a generation number when initially inserted in the linked list. 4. The sorted array is then compacted in O(n). Since it was sorted in a stable way, the first reference for each label is preserved and the duplicates are removed, matching the spec. 5. We can now simply perform a binary search for the current `cmark_reference_lookup` query in O(log n). Any further lookup calls will also be O(log n), since the sorted references table only needs to be generated once. The resulting implementation is notably simple (as it uses standard library builtins `qsort` and `bsearch`), whilst performing better than the fixed size hash table in documents that have a high number of references and never becoming pathological regardless of the input.
2020-02-16Add pathological test for reference collisions (see #220).John MacFarlane
This is taken from GitHub's fix: https://github.com/github/cmark-gfm/commit/66a0836dc91e1653f7931e1218446664493da520
2020-02-11Update date on cmark.1.John MacFarlane
2020-02-11cmark.1 - Document --unsafe instead of --safe.John MacFarlane
Closes #332.
2020-02-11cmark.1: remove docs for `--normalize` which no longer exists.John MacFarlane
See #332
2020-02-09Add cmark_get_default_mem_allocator().John MacFarlane
API change: This adds a new exported function in cmark.h. Closes #330.
2020-01-25Fix URL check in is_autolinkNick Wellnhofer
In a recent commit, the check was changed to strcmp, but we really have to use strncmp.
2020-01-25Fix null pointer deref in is_autolinkNick Wellnhofer
Introduced by a recent commit. Found by OSS-Fuzz.