cmark

My personal build of CMark ✏️

Commit
c739195a341787f89960c5938e4def8d54f66a5a
Parent
b40ecdcd459bff13ecdb0ab586abf22fb223490f
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #217 from github/upstream/limit-nested-parens

> 32 nested balanced parens in a link is bananas

Diffstat

1 file changed, 2 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/inlines.c 2 2 0
diff --git 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;