@@ -1,3 +1,8 @@ | |||||
v0.5.4 (released May 15, 2019): | |||||
- Fixed an unlikely crash in the C tokenizer when interrupted while parsing | |||||
a heading. | |||||
v0.5.3 (released March 30, 2019): | v0.5.3 (released March 30, 2019): | ||||
- Fixed manual construction of Node objects, previously unsupported. (#214) | - Fixed manual construction of Node objects, previously unsupported. (#214) | ||||
@@ -1,6 +1,6 @@ | |||||
# This config file is used by appveyor.com to build Windows release binaries | # This config file is used by appveyor.com to build Windows release binaries | ||||
version: 0.5.3-b{build} | |||||
version: 0.5.4-b{build} | |||||
branches: | branches: | ||||
only: | only: | ||||
@@ -1,6 +1,15 @@ | |||||
Changelog | Changelog | ||||
========= | ========= | ||||
v0.5.4 | |||||
------ | |||||
`Released May 15, 2019 <https://github.com/earwig/mwparserfromhell/tree/v0.5.4>`_ | |||||
(`changes <https://github.com/earwig/mwparserfromhell/compare/v0.5.3...v0.5.4>`__): | |||||
- Fixed an unlikely crash in the C tokenizer when interrupted while parsing | |||||
a heading. | |||||
v0.5.3 | v0.5.3 | ||||
------ | ------ | ||||
@@ -1,6 +1,6 @@ | |||||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||
# | # | ||||
# Copyright (C) 2012-2018 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
# Copyright (C) 2012-2019 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
# | # | ||||
# Permission is hereby granted, free of charge, to any person obtaining a copy | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
# of this software and associated documentation files (the "Software"), to deal | # of this software and associated documentation files (the "Software"), to deal | ||||
@@ -27,9 +27,9 @@ outrageously powerful parser for `MediaWiki <http://mediawiki.org>`_ wikicode. | |||||
""" | """ | ||||
__author__ = "Ben Kurtovic" | __author__ = "Ben Kurtovic" | ||||
__copyright__ = "Copyright (C) 2012-2018 Ben Kurtovic" | |||||
__copyright__ = "Copyright (C) 2012-2019 Ben Kurtovic" | |||||
__license__ = "MIT License" | __license__ = "MIT License" | ||||
__version__ = "0.5.3" | |||||
__version__ = "0.5.4" | |||||
__email__ = "ben.kurtovic@gmail.com" | __email__ = "ben.kurtovic@gmail.com" | ||||
from . import (compat, definitions, nodes, parser, smart_list, string_mixin, | from . import (compat, definitions, nodes, parser, smart_list, string_mixin, | ||||
@@ -813,6 +813,9 @@ static int Tokenizer_parse_heading(Tokenizer* self) | |||||
self->global ^= GL_HEADING; | self->global ^= GL_HEADING; | ||||
return 0; | return 0; | ||||
} | } | ||||
if (!heading) { | |||||
return -1; | |||||
} | |||||
#ifdef IS_PY3K | #ifdef IS_PY3K | ||||
level = PyLong_FromSsize_t(heading->level); | level = PyLong_FromSsize_t(heading->level); | ||||
#else | #else | ||||
@@ -892,6 +895,9 @@ static HeadingData* Tokenizer_handle_heading_end(Tokenizer* self) | |||||
self->head = reset + best - 1; | self->head = reset + best - 1; | ||||
} | } | ||||
else { | else { | ||||
if (!after) { | |||||
return NULL; | |||||
} | |||||
for (i = 0; i < best; i++) { | for (i = 0; i < best; i++) { | ||||
if (Tokenizer_emit_char(self, '=')) { | if (Tokenizer_emit_char(self, '=')) { | ||||
Py_DECREF(after->title); | Py_DECREF(after->title); | ||||