cmark

My personal build of CMark ✏️

Commit
337a86ece811263b8ff2af4fce16b615c95e4bd0
Parent
1533c8fbad3acc48e6a2f0a1e305aeb5932b3bbd
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #10 from nwellnhof/afl

Add Makefile target to fuzz with AFL

Diffstat

2 files changed, 47 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified Makefile 11 11 0
Added test/afl_test_cases/test.md 36 36 0
diff --git a/Makefile b/Makefile
@@ -59,6 +59,17 @@ prof:
 	cmake .. -DCMAKE_BUILD_TYPE=Profile; \
 	make
 
+afl:
+	@[ -n "$(AFL_PATH)" ] || { echo '$$AFL_PATH not set'; false; }
+	mkdir -p $(BUILDDIR)
+	cd $(BUILDDIR) && cmake .. -DCMAKE_C_COMPILER=$(AFL_PATH)/afl-gcc
+	make
+	$(AFL_PATH)/afl-fuzz \
+	    -i test/afl_test_cases \
+	    -o test/afl_results \
+	    -m none \
+	    $(CMARK)
+
 mingw:
 	mkdir -p $(MINGW_BUILDDIR); \
 	cd $(MINGW_BUILDDIR); \
diff --git a/test/afl_test_cases/test.md b/test/afl_test_cases/test.md
@@ -0,0 +1,36 @@
+# H1
+
+H2
+--
+
+t ☺  
+*b* **em** `c`
+&ge;\&\
+\_e\_
+
+4) I1
+
+5) I2
+   > [l](/u "t")
+   >
+   > - [f]
+   > - ![a](/u "t")
+   >
+   >> <ftp://hh>
+   >> <u@hh>
+
+~~~ l☺
+cb
+~~~
+
+    c1
+    c2
+
+***
+
+<div>
+<b>x</b>
+</div>
+
+[f]: /u "t"
+