- Commit
- cb8e0d5cac88e5f1151826833b6d6186fedbd4fc
- Parent
- 4f24c5e65ad4f7f34acf620008b5f824a81f091d
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
commonmark renderer - fixed memory access error.
My personal build of CMark ✏️
commonmark renderer - fixed memory access error.
1 file changed, 1 insertion, 1 deletion
Status | File Name | N° Changes | Insertions | Deletions |
Modified | src/commonmark.c | 2 | 1 | 1 |
diff --git a/src/commonmark.c b/src/commonmark.c @@ -417,7 +417,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, lit(state, " ", false); } out(state, node->as.literal, true, LITERAL); - if (code->data[code->len - 1] == '`') { + if (code->len == 0 || code->data[code->len - 1] == '`') { lit(state, " ", false); } for (i = 0; i < numticks; i++) {