summaryrefslogtreecommitdiff
path: root/src/cmark.h
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-26 11:57:43 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-26 11:57:43 -0700
commitc3f9a7caecbf5239f29b6fd1a7edf47df4fc6d21 (patch)
treefdf0aa4ffb2b8b222015bb60706d4832dd21f30d /src/cmark.h
parent15422f68253bd5d877f0b308b1bf6caec6e0eb79 (diff)
Add EMPHASIS_STACK_LIMIT.
If we get more than 1000 deep in potential emphasis/strong emphasis openers, we refuse to add more to the stack. This prevents the sort of stack overflow we previously got with python -c 'print "*a **a " * 100000; print " a** a*" * 100000' | ./cmark Partially addresses #166.
Diffstat (limited to 'src/cmark.h')
-rw-r--r--src/cmark.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h
index ff2f9a2..5e508e4 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -9,6 +9,7 @@
#define VERSION "0.1"
#define CODE_INDENT 4
+#define EMPHASIS_STACK_LIMIT 1000
struct node_inl {
enum {