diff options
-rw-r--r-- | src/inlines.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/inlines.c b/src/inlines.c index 13dd466..5b2edc6 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -99,9 +99,10 @@ static CMARK_INLINE cmark_node *make_simple(cmark_mem *mem, cmark_node_type t) { static cmark_node *make_str(subject *subj, int sc, int ec, cmark_chunk s) { cmark_node *e = make_literal(subj, CMARK_NODE_TEXT, sc, ec); - // NOLINTNEXTLINE(clang-analyzer-core.NonNullParamChecker) e->data = (unsigned char *)subj->mem->realloc(NULL, s.len + 1); - memcpy(e->data, s.data, s.len); + if (s.data != NULL) { + memcpy(e->data, s.data, s.len); + } e->data[s.len] = 0; e->len = s.len; return e; |