From bfb0116bea8078950c905b5872849d763beea728 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 21 Apr 2004 22:51:51 +0000 Subject: [project @ 2004-04-21 22:51:51 by jmb] Fix crash in tolat1_pre. Thanks to John Tytgat for reporting. svn path=/import/netsurf/; revision=800 --- utils/utils.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'utils/utils.c') diff --git a/utils/utils.c b/utils/utils.c index ed6871c18..1c080e8af 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -160,6 +160,11 @@ char * tolat1_pre(xmlChar * s) while (*s != 0) { chars = length; u = xmlGetUTF8Char((unsigned char *) s, &chars); + if (chars <= 0) { + s += 1; + length -= 1; + continue; + } s += chars; length -= chars; if (u == 0x09 || u == 0x0a || u == 0x0d || -- cgit v1.2.3