fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
306 stars 59 forks source link

Fix bug when processing several files in batch mode with latexmode metadata set #52

Closed gverdier closed 10 years ago

gverdier commented 10 years ago

If several files are processed in batch mode and one the first files has the latexmode metadata set, multimarkdown will dereference a previously freed pointer, which can make it crash.

When the file with the latexmode metadata is processed, target_meta_key is set to point to this metadata (multimarkdown.c:321) and then freed (multimarkdown.c:329). However, it is not reset to null, so when the next file is processed, target_meta_key still points to freed metadata and is accessed in extract_metadata_value (multimarkdown.c:304).

fletcher commented 10 years ago

Thanks for the detailed information and the pull request!