From 98dc30902d35c714a70aca8e6616f49d71cb24cc Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 30 Mar 2019 23:33:53 -0400 Subject: [PATCH 1/3] Version bump --- CHANGELOG | 4 ++++ appveyor.yml | 2 +- docs/changelog.rst | 8 ++++++++ mwparserfromhell/__init__.py | 6 +++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 217ffba..918c37f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v0.6 (unreleased): + +- ... + v0.5.3 (released March 30, 2019): - Fixed manual construction of Node objects, previously unsupported. (#214) diff --git a/appveyor.yml b/appveyor.yml index 067bffb..076fc21 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ # This config file is used by appveyor.com to build Windows release binaries -version: 0.5.3-b{build} +version: 0.6.dev0-b{build} branches: only: diff --git a/docs/changelog.rst b/docs/changelog.rst index afdddd6..a18c7f8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,14 @@ Changelog ========= +v0.6 +---- + +Unreleased +(`changes `__): + +- ... + v0.5.3 ------ diff --git a/mwparserfromhell/__init__.py b/mwparserfromhell/__init__.py index eefe79a..e8aa944 100644 --- a/mwparserfromhell/__init__.py +++ b/mwparserfromhell/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2012-2018 Ben Kurtovic +# Copyright (C) 2012-2019 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,9 +27,9 @@ outrageously powerful parser for `MediaWiki `_ wikicode. """ __author__ = "Ben Kurtovic" -__copyright__ = "Copyright (C) 2012-2018 Ben Kurtovic" +__copyright__ = "Copyright (C) 2012-2019 Ben Kurtovic" __license__ = "MIT License" -__version__ = "0.5.3" +__version__ = "0.6.dev0" __email__ = "ben.kurtovic@gmail.com" from . import (compat, definitions, nodes, parser, smart_list, string_mixin, From 8c5f554406a63ceafa2829ec6b5b36260883b9a3 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 14 May 2019 23:51:21 -0400 Subject: [PATCH 2/3] Add guard against a rare crash in the C tokenizer --- CHANGELOG | 5 +++-- docs/changelog.rst | 5 +++-- mwparserfromhell/parser/ctokenizer/tok_parse.c | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 918c37f..a37680d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ -v0.6 (unreleased): +v0.5.4 (unreleased): -- ... +- Fixed an unlikely crash in the C tokenizer when interrupted while parsing + a heading. v0.5.3 (released March 30, 2019): diff --git a/docs/changelog.rst b/docs/changelog.rst index a18c7f8..bb81c42 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,13 +1,14 @@ Changelog ========= -v0.6 +v0.5.4 ---- Unreleased (`changes `__): -- ... +- Fixed an unlikely crash in the C tokenizer when interrupted while parsing + a heading. v0.5.3 ------ diff --git a/mwparserfromhell/parser/ctokenizer/tok_parse.c b/mwparserfromhell/parser/ctokenizer/tok_parse.c index ab46252..c32e48c 100644 --- a/mwparserfromhell/parser/ctokenizer/tok_parse.c +++ b/mwparserfromhell/parser/ctokenizer/tok_parse.c @@ -813,6 +813,9 @@ static int Tokenizer_parse_heading(Tokenizer* self) self->global ^= GL_HEADING; return 0; } + if (!heading) { + return -1; + } #ifdef IS_PY3K level = PyLong_FromSsize_t(heading->level); #else @@ -892,6 +895,9 @@ static HeadingData* Tokenizer_handle_heading_end(Tokenizer* self) self->head = reset + best - 1; } else { + if (!after) { + return NULL; + } for (i = 0; i < best; i++) { if (Tokenizer_emit_char(self, '=')) { Py_DECREF(after->title); From 18646f712fbaa532e3fee5e5cfe289c3ba0c39f1 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 15 May 2019 00:05:25 -0400 Subject: [PATCH 3/3] release/0.5.4 --- CHANGELOG | 2 +- appveyor.yml | 2 +- docs/changelog.rst | 6 +++--- mwparserfromhell/__init__.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a37680d..7c85c2b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -v0.5.4 (unreleased): +v0.5.4 (released May 15, 2019): - Fixed an unlikely crash in the C tokenizer when interrupted while parsing a heading. diff --git a/appveyor.yml b/appveyor.yml index 076fc21..3d738e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ # This config file is used by appveyor.com to build Windows release binaries -version: 0.6.dev0-b{build} +version: 0.5.4-b{build} branches: only: diff --git a/docs/changelog.rst b/docs/changelog.rst index bb81c42..808e9b9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,10 +2,10 @@ Changelog ========= v0.5.4 ----- +------ -Unreleased -(`changes `__): +`Released May 15, 2019 `_ +(`changes `__): - Fixed an unlikely crash in the C tokenizer when interrupted while parsing a heading. diff --git a/mwparserfromhell/__init__.py b/mwparserfromhell/__init__.py index e8aa944..4e4d440 100644 --- a/mwparserfromhell/__init__.py +++ b/mwparserfromhell/__init__.py @@ -29,7 +29,7 @@ outrageously powerful parser for `MediaWiki `_ wikicode. __author__ = "Ben Kurtovic" __copyright__ = "Copyright (C) 2012-2019 Ben Kurtovic" __license__ = "MIT License" -__version__ = "0.6.dev0" +__version__ = "0.5.4" __email__ = "ben.kurtovic@gmail.com" from . import (compat, definitions, nodes, parser, smart_list, string_mixin,