summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-23 21:09:41 +0200
committerGitHub <noreply@github.com>2017-06-23 21:09:41 +0200
commit00291fd1811eba348f649f74f4c727625f0be945 (patch)
tree6594ef91afff0c20c8c15cf6dae9665a399dd7dd
parent60aa732dcfc2578a96530bdd73262112fb6bbdf2 (diff)
parent55b029fb66fbbaed969ce81ed77d57f033cd0db4 (diff)
Merge pull request #207 from github/upstream/oob-read
Reset bytes after (possible) UTF8 proc
-rw-r--r--src/blocks.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 98868d3..5a293b2 100644
--- 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');