summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-05 12:56:16 -0500
committerGitHub <noreply@github.com>2017-11-05 12:56:16 -0500
commitc739195a341787f89960c5938e4def8d54f66a5a (patch)
tree39b4872a9741baedd992c1dea67227f192efb977
parentb40ecdcd459bff13ecdb0ab586abf22fb223490f (diff)
parent45f4fc9b917c11221aa03e70a41e3046335a235d (diff)
Merge pull request #217 from github/upstream/limit-nested-parens
> 32 nested balanced parens in a link is bananas
-rw-r--r--src/inlines.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 3bade11..d0ab253 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -898,6 +898,8 @@ static bufsize_t manual_scan_link_url_2(cmark_chunk *input, bufsize_t offset,
else if (input->data[i] == '(') {
++nb_p;
++i;
+ if (nb_p > 32)
+ return -1;
} else if (input->data[i] == ')') {
if (nb_p == 0)
break;