aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/c/expat/xmltok_impl.c
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-09 15:33:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-09-09 15:33:15 +0200
commitb998434099e615ed6222c3c63c050db0e0bd2bd1 (patch)
tree3fe55d809ce09d52b1715deafeba402543760e18 /libxsde/xsde/c/expat/xmltok_impl.c
parent924ac19858a9afebba1809a0549395836d588b0c (diff)
Import fixes for Expat security vulnerabilities
Specifically: CVE-2022-25315 CVE-2022-25313 CVE-2022-25236 CVE-2022-25235 CVE-2022-23990 CVE-2022-23852 CVE-2022-22822-22827 CVE-2021-46143 CVE-2021-45960
Diffstat (limited to 'libxsde/xsde/c/expat/xmltok_impl.c')
-rw-r--r--libxsde/xsde/c/expat/xmltok_impl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libxsde/xsde/c/expat/xmltok_impl.c b/libxsde/xsde/c/expat/xmltok_impl.c
index 79ffafd..0a7fe34 100644
--- a/libxsde/xsde/c/expat/xmltok_impl.c
+++ b/libxsde/xsde/c/expat/xmltok_impl.c
@@ -34,7 +34,7 @@
case BT_LEAD ## n: \
if (end - ptr < n) \
return XML_TOK_PARTIAL_CHAR; \
- if (!IS_NAME_CHAR(enc, ptr, n)) { \
+ if (IS_INVALID_CHAR(enc, ptr, n) || !IS_NAME_CHAR(enc, ptr, n)) { \
*nextTokPtr = ptr; \
return XML_TOK_INVALID; \
} \
@@ -62,7 +62,7 @@
case BT_LEAD ## n: \
if (end - ptr < n) \
return XML_TOK_PARTIAL_CHAR; \
- if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \
+ if (IS_INVALID_CHAR(enc, ptr, n) || !IS_NMSTRT_CHAR(enc, ptr, n)) { \
*nextTokPtr = ptr; \
return XML_TOK_INVALID; \
} \
@@ -1103,6 +1103,10 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
case BT_LEAD ## n: \
if (end - ptr < n) \
return XML_TOK_PARTIAL_CHAR; \
+ if (IS_INVALID_CHAR(enc, ptr, n)) { \
+ *nextTokPtr = ptr; \
+ return XML_TOK_INVALID; \
+ } \
if (IS_NMSTRT_CHAR(enc, ptr, n)) { \
ptr += n; \
tok = XML_TOK_NAME; \