Commit af03791316385b3c4fb3ad516355f2e5cbc8f5e2

Martin Mitas 2016-10-14T23:29:48

md_is_html_declaration: Fix possible access beyond document buffer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 02fb991..f4cd66b 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -629,9 +629,8 @@ md_is_html_declaration(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, 
 
     while(1) {
         while(off < lines[i].end) {
-            if(CH(off+1) == _T('>')) {
+            if(CH(off) == _T('>')) {
                 /* Success. */
-                off++;
                 goto done;
             }