netcdf/CVE-2021-31348.patch
dengyuyu a47eafa51d fix CVE-2021-31348
(cherry picked from commit 97b24e5cf6bc302075febd7707e65d9444e03e36)
2022-07-15 17:55:13 +08:00

13 lines
714 B
Diff

diff -Naru "netcdf-c-4.7.3 copy/libdap4/ezxml.c" netcdf-c-4.7.3/libdap4/ezxml.c
--- "netcdf-c-4.7.3 copy/libdap4/ezxml.c" 2022-07-13 10:24:32.128424000 +0800
+++ netcdf-c-4.7.3/libdap4/ezxml.c 2022-07-13 10:24:57.220170000 +0800
@@ -574,7 +574,7 @@
for (l = 0; *s && ((! l && *s != '>') || (l && (*s != ']' ||
*(s + strspn(s + 1, EZXML_WS) + 1) != '>')));
l = (*s == '[') ? 1 : l) s += strcspn(s + 1, "[]>") + 1;
- if (! *s && e != '>')
+ if (! *s)
return ezxml_err(root, d, "unclosed <!DOCTYPE");
d = (l) ? strchr(d, '[') + 1 : d;
if (l && ! ezxml_internal_dtd(root, d, s++ - d)) return &root->xml;