-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash rendering markdown #126
Comments
I spent some time investigating this today. You'll notice that cmark_chunk_free() doesn't call xcalloc() and that's the proximate cause of the crash. Without going through all the details there is a missing #include in the cmark file parser.h. It should look like this #include <stdio.h> references.h is missing. When added in that order this crash goes away. |
I'm happy to accept pull requests, but prefer they be made upstream into https://github.com/commonmark/cmark |
They already fixed this based on my issue filed there. There's no real way for me to tell when they might have a new versioned release and I think it's been over a year since their 0.28.3 version. We can either add this one change in our source base or pull the latest code from their HEAD. I can make a PR either way in the next few days. I would probably recommend pulling their latest code. See also |
@phoney I'd rather patch the 0.28.3 version for now in this repo and anyone is welcome to create a branch based off the HEAD of cmark if they want to live a little closer to the edge Stability is really important since many people are using this in production so I want to ensure we're tracking to the stable releases of cmark. |
fixed in #129 |
Report
Crash rendering markdown
What did you do?
This Swift snippet crashes:
I tried running this as a cmark test and it appears to work there, so I'm a bit confused. It definitely looks like a cmark bug, but I haven't dug in enough yet to be sure.
What did you expect to happen?
Markdown should render
What happened instead?
The text was updated successfully, but these errors were encountered: