cmark

My personal build of CMark ✏️

Commit
00291fd1811eba348f649f74f4c727625f0be945
Parent
60aa732dcfc2578a96530bdd73262112fb6bbdf2
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #207 from github/upstream/oob-read

Reset bytes after (possible) UTF8 proc

Diffstat

1 file changed, 2 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/blocks.c 2 2 0
diff --git a/src/blocks.c b/src/blocks.c
@@ -1146,6 +1146,8 @@ static void S_process_line(cmark_parser *parser, const unsigned char *buffer,
   else
     cmark_strbuf_put(&parser->curline, buffer, bytes);
 
+  bytes = parser->curline.size;
+
   // ensure line ends with a newline:
   if (bytes == 0 || !S_is_line_end_char(parser->curline.ptr[bytes - 1]))
     cmark_strbuf_putc(&parser->curline, '\n');