Skip to content

Commit

Permalink
Merge pull request #217 from github/upstream/limit-nested-parens
Browse files Browse the repository at this point in the history
> 32 nested balanced parens in a link is bananas
  • Loading branch information
jgm authored Nov 5, 2017
2 parents b40ecdc + 45f4fc9 commit c739195
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c739195

Please sign in to comment.