Commit c6535ff3daa4d9d66eb44be7fdedba4da7ef1510

Martin Mitas 2024-01-10T21:39:24

Fix eof handling in a middle of task list item.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/md4c.c b/src/md4c.c
index c9014f7..3b1cca2 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -6141,7 +6141,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
                 task_container->is_task = TRUE;
                 task_container->task_mark_off = tmp + 1;
                 off = tmp + 3;
-                while(ISWHITESPACE(off))
+                while(off < ctx->size  &&  ISWHITESPACE(off))
                     off++;
                 line->beg = off;
             }