You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Down project uses the code from the cmark project (currently it uses the code pulled from the v0.28.3 tag). A crashing bug was reported to Down that I've tracked down to a missing #include in parser.h. johnxnguyen/Down#126
The stack trace for the crash shows:
0 xcalloc
1 cmark_chunk_free
2 reference_free
cmark_chunk_free() doesn't call xcalloc. It calls mem->free(). Because of the missing #include the compiler calls mem-> xcalloc() instead of mem->free(). Making the #includes in parser.h like this fixes the crash:
Using the struct keyword on this line in parser.h contributes to this issue struct cmark_reference_map *refmap;
Reordering the #includes in references.c also fixes this if references.h comes before parser.h. I'm not sure why references.h has to go first in parser.h to fix this though.
I don't know if there's something about how cmark is compiled in the Down project that causes this or if the reference_free() function isn't called with most markdown or if there's some other reason this hasn't been noticed before.
Hope you can fix this.
The text was updated successfully, but these errors were encountered:
The Down project uses the code from the cmark project (currently it uses the code pulled from the v0.28.3 tag). A crashing bug was reported to Down that I've tracked down to a missing #include in parser.h. johnxnguyen/Down#126
The stack trace for the crash shows:
cmark_chunk_free() doesn't call xcalloc. It calls mem->free(). Because of the missing #include the compiler calls mem-> xcalloc() instead of mem->free(). Making the #includes in parser.h like this fixes the crash:
Using the struct keyword on this line in parser.h contributes to this issue
struct cmark_reference_map *refmap;
Reordering the #includes in references.c also fixes this if references.h comes before parser.h. I'm not sure why references.h has to go first in parser.h to fix this though.
I don't know if there's something about how cmark is compiled in the Down project that causes this or if the reference_free() function isn't called with most markdown or if there's some other reason this hasn't been noticed before.
Hope you can fix this.
The text was updated successfully, but these errors were encountered: