diff options
author | kwaclaw <kwaclaw> | 2002-07-29 01:05:11 +0000 |
---|---|---|
committer | kwaclaw <kwaclaw> | 2002-07-29 01:05:11 +0000 |
commit | 2312699ed2e0c0a727512e3e176b38cc2953fe33 (patch) | |
tree | 3aead4aba038b6aa30d8021458d000d8e0bc6c3c /lib/xmltok.c | |
parent | c0589f6e2c06c01ef56b0a64b93bd3d141282964 (diff) | |
download | libexpat-2312699ed2e0c0a727512e3e176b38cc2953fe33.tar.gz |
Applied patch for bug #434664: utf8_toutf16 infinite loop.
Diffstat (limited to 'lib/xmltok.c')
-rw-r--r-- | lib/xmltok.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/xmltok.c b/lib/xmltok.c index 1677d2d..7fc00e8 100644 --- a/lib/xmltok.c +++ b/lib/xmltok.c @@ -343,7 +343,7 @@ utf8_toUtf16(const ENCODING *enc, { unsigned long n; if (to + 1 == toLim) - break; + goto after; n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); n -= 0x10000; @@ -358,6 +358,7 @@ utf8_toUtf16(const ENCODING *enc, break; } } +after: *fromP = from; *toP = to; } |