Commit 64c2a551 authored by Holger Levsen's avatar Holger Levsen

Full UTF-8 support, thanksto Dmitry Borisyuk, Closes: #732702, #692861, #545695 and Catch ENOMEM

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent b2807fad
html2text (1.3.2a-25) UNRELEASED; urgency=medium
* Full UTF-8 support (rewritten Area.C by Dmitry Borisyuk, Closes: #732702
Closes: #692861, #545695
* Catch ENOMEM in {m,re}alloc_array in Area.C., also by Dmitry Borisyuk.
* Disable debian/patches/960-fix-utf8-mode-quadratic-runtime.patch
* because of the latter it's UNRELEASED for now.
-- Holger Levsen <holger@debian.org> Wed, 27 Feb 2019 20:14:45 +0100
html2text (1.3.2a-24) unstable; urgency=medium
* Add patch from Dmitry Borisyuk <q1werty@i.com.ua> (thanks!) to fix crashes
......
Description: Catch ENOMEM in {m,re}alloc_array (prevent segfaults).
Author: Dmitry Borisyuk <q1werty@i.com.ua>
--- a/Area.C
+++ b/Area.C
@@ -30,7 +30,7 @@
/***************************************************************************/
-
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
@@ -45,10 +45,14 @@
/* ------------------------------------------------------------------------- */
+static void* alloc_error() {
+ perror("html2text: error"); abort();
+}
+
#define malloc_array(type, size)\
-((type *) malloc(sizeof(type) * (size)))
+((type *) (malloc(sizeof(type) * (size)) ? : alloc_error()))
#define realloc_array(array, type, size) \
-((array) = (type *) realloc((array), sizeof(type) * (size)))
+((array) = (type *) (realloc((array), sizeof(type) * (size)) ? : alloc_error()))
#define copy_array(from, to, type, count) \
((void) memcpy((to), (from), (count) * sizeof(type)))
This diff is collapsed.
......@@ -12,5 +12,7 @@
810-fix-deprecated-conversion-warnings.patch
900-complete-utf8-entities-table.patch
950-validate-width-parameter.patch
960-fix-utf8-mode-quadratic-runtime.patch
970-716064.patch
catch-ENOMEM.patch
fix-utf8-support.patch
#960-fix-utf8-mode-quadratic-runtime.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment