summaryrefslogtreecommitdiff
path: root/dev-libs/libwbxml/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /dev-libs/libwbxml/files
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'dev-libs/libwbxml/files')
-rw-r--r--dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch116
1 files changed, 116 insertions, 0 deletions
diff --git a/dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch b/dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch
new file mode 100644
index 000000000000..00479c7f6437
--- /dev/null
+++ b/dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch
@@ -0,0 +1,116 @@
+https://github.com/libwbxml/libwbxml/commit/4664d476fb5029073012b91880ce2a9bbc0b4725
+https://github.com/libwbxml/libwbxml/commit/4425e80f74b93a590b2c99638b9c5095e6a66244
+
+From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz>
+Date: Thu, 24 Feb 2022 20:30:18 +0100
+Subject: [PATCH] Allow the use of a namespace separator specified by the
+ constant instead of hardcoded colon in the SyncML related code.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
+--- a/src/wbxml_internals.h
++++ b/src/wbxml_internals.h
+@@ -156,7 +156,9 @@ typedef enum WBXMLWVDataType_e {
+ #pragma warning(error: 4761) /**< integral size mismatch in argument : conversion supplied */
+ #endif /* WIN32 */
+
+-#define WBXML_NAMESPACE_SEPARATOR ':'
++/* Separator must be the same in both cases - once as a char, once as a string */
++#define WBXML_NAMESPACE_SEPARATOR ':'
++#define WBXML_NAMESPACE_SEPARATOR_STR ":"
+
+ /** @} */
+
+--- a/src/wbxml_tree_clb_xml.c
++++ b/src/wbxml_tree_clb_xml.c
+@@ -33,6 +33,7 @@
+ * @brief WBXML Tree Callbacks for XML Parser (Expat)
+ */
+
++#include "wbxml_internals.h"
+ #include "wbxml_config_internals.h"
+
+ #if defined( HAVE_EXPAT )
+@@ -160,8 +161,8 @@ void wbxml_tree_clb_xml_start_element(void *ctx,
+ * potentially embedded documents.
+ */
+ if ((
+- (WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0) ||
+- (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0)
++ (WBXML_STRCMP(localName, "syncml:devinf" WBXML_NAMESPACE_SEPARATOR_STR "DevInf") == 0) ||
++ (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0)
+ )&&
+ (tree_ctx->current != NULL))
+ {
+@@ -255,8 +256,8 @@ void wbxml_tree_clb_xml_end_element(void *ctx,
+ /* End of skipped node */
+
+ #if defined( WBXML_SUPPORT_SYNCML )
+- if (WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0 ||
+- WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0) {
++ if (WBXML_STRCMP(localName, "syncml:devinf" WBXML_NAMESPACE_SEPARATOR_STR "DevInf") == 0 ||
++ WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0) {
+ /* definitions first ... or some compilers don't like it */
+ WBXMLBuffer *embed_doc = NULL;
+ WBXMLTree *tree = NULL;
+@@ -277,10 +278,10 @@ void wbxml_tree_clb_xml_end_element(void *ctx,
+ }
+
+ /* Check Buffer Creation and add the closing tag */
+- if ((WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0 &&
++ if ((WBXML_STRCMP(localName, "syncml:devinf" WBXML_NAMESPACE_SEPARATOR_STR "DevInf") == 0 &&
+ (!wbxml_buffer_append_cstr(embed_doc, "</DevInf>")))
+ ||
+- (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0 &&
++ (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0 &&
+ (!wbxml_buffer_append_cstr(embed_doc, "</MgmtTree>"))))
+ {
+ tree_ctx->error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+@@ -289,7 +290,7 @@ void wbxml_tree_clb_xml_end_element(void *ctx,
+ }
+
+ /* Add doctype to give the XML parser a chance */
+- if (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0 &&
++ if (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0 &&
+ tree_ctx->tree->lang->langID != WBXML_LANG_SYNCML_SYNCML12)
+ {
+ tree_ctx->error = WBXML_ERROR_UNKNOWN_XML_LANGUAGE;
+@@ -305,7 +306,7 @@ void wbxml_tree_clb_xml_end_element(void *ctx,
+ lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF11);
+ break;
+ case WBXML_LANG_SYNCML_SYNCML12:
+- if (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0) {
++ if (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0) {
+ lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DMDDF12);
+ } else {
+ lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF12);
+
+From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz>
+Date: Thu, 24 Feb 2022 20:31:15 +0100
+Subject: [PATCH] Change the default internal namespace separator from the
+ colon to the pipe.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This solves compatibility with libexpat >= 2.4.5
+after fix the security problem CVE-2022-25236.
+
+This resolves issue #76.
+
+Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
+--- a/src/wbxml_internals.h
++++ b/src/wbxml_internals.h
+@@ -157,8 +157,8 @@ typedef enum WBXMLWVDataType_e {
+ #endif /* WIN32 */
+
+ /* Separator must be the same in both cases - once as a char, once as a string */
+-#define WBXML_NAMESPACE_SEPARATOR ':'
+-#define WBXML_NAMESPACE_SEPARATOR_STR ":"
++#define WBXML_NAMESPACE_SEPARATOR '|'
++#define WBXML_NAMESPACE_SEPARATOR_STR "|"
+
+ /** @} */
+