Skip to content

Commit 5a3db92

Browse files
Merge remote-tracking branch 'github/master' into vmitchell/sync-upstream-gfm.7
rdar://104622655
2 parents 25d503f + 00ba25c commit 5a3db92

32 files changed

+14703
-10690
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ build
3333
cmark.dSYM/*
3434
cmark
3535
.vscode
36+
.DS_Store
3637

3738
# Testing and benchmark
3839
alltests.md

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ set(CMAKE_C_STANDARD_REQUIRED YES)
3131
# Use CMake's generated headers instead of the Swift package prebuilt ones
3232
add_compile_definitions(CMARK_USE_CMAKE_HEADERS)
3333

34+
option(CMARK_FUZZ_QUADRATIC "Build quadratic fuzzing harness" OFF)
35+
36+
if(CMARK_FUZZ_QUADRATIC)
37+
set(FUZZER_FLAGS "-fsanitize=fuzzer-no-link,address -g")
38+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FUZZER_FLAGS}")
39+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FUZZER_FLAGS}")
40+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FUZZER_FLAGS}")
41+
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FUZZER_FLAGS}")
42+
endif()
43+
3444
add_subdirectory(src)
3545
add_subdirectory(extensions)
3646
if(CMARK_TESTS AND (CMARK_SHARED OR CMARK_STATIC))
@@ -41,6 +51,9 @@ if(CMARK_TESTS)
4151
enable_testing()
4252
add_subdirectory(test testdir)
4353
endif()
54+
if(CMARK_FUZZ_QUADRATIC)
55+
add_subdirectory(fuzz)
56+
endif()
4457

4558
if(NOT CMAKE_BUILD_TYPE)
4659
set(CMAKE_BUILD_TYPE "Release" CACHE STRING

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ VERSION?=$(SPECVERSION)
2222
RELEASE?=CommonMark-$(VERSION)
2323
INSTALL_PREFIX?=/usr/local
2424
CLANG_CHECK?=clang-check
25-
CLANG_FORMAT=clang-format-3.5 -style llvm -sort-includes=0 -i
25+
CLANG_FORMAT=clang-format -style llvm -sort-includes=0 -i
2626
AFL_PATH?=/usr/local/bin
2727

2828
.PHONY: all cmake_build leakcheck clean fuzztest test debug ubsan asan mingw archive newbench bench format update-spec afl clang-check docker libFuzzer
@@ -140,7 +140,7 @@ $(EXTDIR)/ext_scanners.c: $(EXTDIR)/ext_scanners.re
140140
esac
141141
re2c --case-insensitive -b -i --no-generation-date -8 \
142142
--encoding-policy substitute -o $@ $<
143-
clang-format-3.5 -style llvm -i $@
143+
clang-format -style llvm -i $@
144144

145145
# We include entities.inc in the repository, so normally this
146146
# doesn't need to be regenerated:
@@ -211,7 +211,7 @@ format:
211211
$(CLANG_FORMAT) src/*.c src/*.h api_test/*.c api_test/*.h
212212

213213
format-extensions:
214-
clang-format-3.5 -style llvm -i extensions/*.c extensions/*.h
214+
clang-format -style llvm -i extensions/*.c extensions/*.h
215215

216216
operf: $(CMARK)
217217
operf $< < $(BENCHFILE) > /dev/null

api_test/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,7 @@ int main() {
15751575
int retval;
15761576
test_batch_runner *runner = test_batch_runner_new();
15771577

1578+
cmark_init_standard_node_flags();
15781579
version(runner);
15791580
constructor(runner);
15801581
accessors(runner);

bin/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ int main(int argc, char *argv[]) {
143143
}
144144
#endif
145145

146+
cmark_init_standard_node_flags();
146147
cmark_gfm_core_extensions_ensure_registered();
147148

148149
#ifdef USE_PLEDGE

changelog.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
[0.29.0.gfm.7]
2+
3+
* Fixed a polynomial time complexity issue per
4+
https://github.com/github/cmark-gfm/security/advisories/GHSA-r572-jvj2-3m8p
5+
* Fixed an issue in which crafted markdown document could trigger an
6+
out-of-bounds read in the validate_protocol function per
7+
https://github.com/github/cmark-gfm/security/advisories/GHSA-c944-cv5f-hpvr
8+
* Fixed a polynomial time complexity issue
9+
https://github.com/github/cmark-gfm/security/advisories/GHSA-24f7-9frr-5h2r
10+
* Fixed several polynomial time complexity issues per
11+
https://github.com/github/cmark-gfm/security/advisories/GHSA-29g3-96g3-jg6c
12+
* We removed an unneeded .DS_Store file (#291)
13+
* We added a test for domains with underscores and fix roundtrip behavior (#292)
14+
* We now use an up-to-date clang-format (#294)
15+
* We made a variety of implicit integer trunctions explicit by moving to
16+
size_t as our standard size integer type (#302)
17+
118
[0.29.0.gfm.6]
219
* Fixed polynomial time complexity DoS vulnerability in autolink extension
320

0 commit comments

Comments
 (0)