summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-17 10:15:57 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-17 12:30:01 -0700
commita804ce024b8fdc849b59a74826e6aa4774f7ddd1 (patch)
tree7349602b8e895bd8c0b1d44e39d3b3978ef1147d /src/blocks.c
parent67ad9d17dfbe26e3ac526715d283e2667f28998c (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.c3
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;
}
}