From c3f9a7caecbf5239f29b6fd1a7edf47df4fc6d21 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Oct 2014 11:57:43 -0700 Subject: 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. --- src/cmark.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/cmark.h') 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 { -- cgit v1.2.3