summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-04-21 22:51:51 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-04-21 22:51:51 +0000
commitbfb0116bea8078950c905b5872849d763beea728 (patch)
treee10e7706cfbb13c257b4823be9b0a96e6924252c /utils
parent3662d2aec7843a6e6ff155ee1522d42c1cffdd52 (diff)
downloadnetsurf-bfb0116bea8078950c905b5872849d763beea728.tar.gz
netsurf-bfb0116bea8078950c905b5872849d763beea728.tar.bz2
[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
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c5
1 files changed, 5 insertions, 0 deletions
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 ||