summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-03-29 17:05:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-03-29 17:05:29 -0700
commitcb8e0d5cac88e5f1151826833b6d6186fedbd4fc (patch)
treefbf324f4c9d55d204596f16443d502434797d123
parent4f24c5e65ad4f7f34acf620008b5f824a81f091d (diff)
commonmark renderer - fixed memory access error.
-rw-r--r--src/commonmark.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commonmark.c b/src/commonmark.c
index b8ff25b..c266bf6 100644
--- 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++) {