diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-17 10:15:57 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-17 12:30:01 -0700 |
commit | a804ce024b8fdc849b59a74826e6aa4774f7ddd1 (patch) | |
tree | 7349602b8e895bd8c0b1d44e39d3b3978ef1147d /src/blocks.c | |
parent | 67ad9d17dfbe26e3ac526715d283e2667f28998c (diff) |
Fixed off-by-one error in line splitting routine.
This caused certain NULLs not to be replaced.
Found my 'make fuzztest'.
Diffstat (limited to 'src/blocks.c')
-rw-r--r-- | src/blocks.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/blocks.c b/src/blocks.c index 17288df..637385c 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -506,7 +506,6 @@ S_parser_feed(cmark_parser *parser, const unsigned char *buffer, size_t len, const unsigned char *eol; bufsize_t chunk_len; bool process = false; - for (eol = buffer; eol < end; ++eol) { if (S_is_line_end_char(*eol)) { if (eol < end && *eol == '\r') @@ -516,7 +515,7 @@ S_parser_feed(cmark_parser *parser, const unsigned char *buffer, size_t len, process = true; break; } - if (*eol == '\0' && eol < end - 1) { + if (*eol == '\0' && eol < end) { break; } } |