Skip to content

Commit

Permalink
Merge pull request #49 from jeroenooms/master
Browse files Browse the repository at this point in the history
Fix for UBSAN note
  • Loading branch information
jgm committed May 31, 2015
2 parents 9dd842c + e10aa85 commit 32d1973
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ static inline const char *cmark_chunk_to_cstr(cmark_chunk *c)
}
str = (unsigned char *)malloc(c->len + 1);
if(str != NULL) {
memcpy(str, c->data, c->len);
if(c->len > 0){
memcpy(str, c->data, c->len);
}
str[c->len] = 0;
}
c->data = str;
Expand Down

0 comments on commit 32d1973

Please sign in to comment.