summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpvalchev <pvalchev@openbsd.org>2008-06-14 01:22:19 +0000
committerpvalchev <pvalchev@openbsd.org>2008-06-14 01:22:19 +0000
commitf14316efa0b68d99a2ff4333993ff9db1de81a58 (patch)
tree2c6425170b9e8e5abbbdd79bb74cc7035e072259
parentClean up nfsrv_wakenfsd(); variable name change to be in line with the (diff)
downloadwireguard-openbsd-f14316efa0b68d99a2ff4333993ff9db1de81a58.tar.xz
wireguard-openbsd-f14316efa0b68d99a2ff4333993ff9db1de81a58.zip
slightly more robust fix in not relying on utf-8 sequences being well
formed after discussion w/ upstream
-rw-r--r--lib/libexpat/lib/xmltok_impl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libexpat/lib/xmltok_impl.c b/lib/libexpat/lib/xmltok_impl.c
index 8154c1afa92..16dfb85f031 100644
--- a/lib/libexpat/lib/xmltok_impl.c
+++ b/lib/libexpat/lib/xmltok_impl.c
@@ -1744,13 +1744,10 @@ PREFIX(updatePosition)(const ENCODING *enc,
const char *end,
POSITION *pos)
{
- while (ptr != end) {
+ while (ptr < end) {
switch (BYTE_TYPE(enc, ptr)) {
#define LEAD_CASE(n) \
case BT_LEAD ## n: \
- if (end - ptr < n) { \
- return; \
- } \
ptr += n; \
break;
LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)