aboutsummaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-connectivity/gupnp/gupnp/0001-all-Drop-xmlRecoverMemory.patch
blob: a3941f345f496328edb309dc77fb39bea9ea3053 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
From 46f13d9929c81ec2340a1a5d48f596b1892c5a81 Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Thu, 4 May 2023 19:14:29 +0200
Subject: [PATCH] all: Drop xmlRecoverMemory

use xmlReadMemory, also use NONET flat

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Upstream-Status: Backport [https://github.com/GNOME/gupnp/commit/80e68995b745a5900eaaa1d0c424d3a9d354e42d]
---
 libgupnp/gupnp-control-point.c        | 7 +++++--
 libgupnp/gupnp-service-info.c         | 7 +++++--
 libgupnp/gupnp-service-proxy-action.c | 7 +++++--
 libgupnp/gupnp-service-proxy.c        | 7 +++++--
 libgupnp/gupnp-service.c              | 7 +++++--
 5 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/libgupnp/gupnp-control-point.c b/libgupnp/gupnp-control-point.c
index dc04732..99ebda5 100644
--- a/libgupnp/gupnp-control-point.c
+++ b/libgupnp/gupnp-control-point.c
@@ -608,8 +608,11 @@ got_description_url (SoupSession           *session,
                 xmlDoc *xml_doc;
 
                 /* Parse response */
-                xml_doc = xmlRecoverMemory (msg->response_body->data,
-                                            msg->response_body->length);
+                xml_doc = xmlReadMemory (msg->response_body->data,
+                                         msg->response_body->length,
+                                         NULL,
+                                         NULL,
+                                         XML_PARSE_NONET | XML_PARSE_RECOVER);
                 if (xml_doc) {
                         doc = gupnp_xml_doc_new (xml_doc);
 
diff --git a/libgupnp/gupnp-service-info.c b/libgupnp/gupnp-service-info.c
index 9a9f4de..d468801 100644
--- a/libgupnp/gupnp-service-info.c
+++ b/libgupnp/gupnp-service-info.c
@@ -592,8 +592,11 @@ got_scpd_url (G_GNUC_UNUSED SoupSession *session,
         if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
                 xmlDoc *scpd;
 
-                scpd = xmlRecoverMemory (msg->response_body->data,
-                                         msg->response_body->length);
+                scpd = xmlReadMemory (msg->response_body->data,
+                                      msg->response_body->length,
+                                      NULL,
+                                      NULL,
+                                      XML_PARSE_NONET | XML_PARSE_RECOVER);
                 if (scpd) {
                         introspection = gupnp_service_introspection_new (scpd);
 
diff --git a/libgupnp/gupnp-service-proxy-action.c b/libgupnp/gupnp-service-proxy-action.c
index 4d9336c..ef8a808 100644
--- a/libgupnp/gupnp-service-proxy-action.c
+++ b/libgupnp/gupnp-service-proxy-action.c
@@ -86,8 +86,11 @@ check_action_response (G_GNUC_UNUSED GUPnPServiceProxy *proxy,
         }
 
         /* Parse response */
-        response = xmlRecoverMemory (action->msg->response_body->data,
-                                     action->msg->response_body->length);
+        response = xmlReadMemory (action->msg->response_body->data,
+                                  action->msg->response_body->length,
+                                  NULL,
+                                  NULL,
+                                  XML_PARSE_NONET | XML_PARSE_RECOVER);
 
         if (!response) {
                 if (action->msg->status_code == SOUP_STATUS_OK) {
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 25d5ef6..af2fd46 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -1560,8 +1560,11 @@ server_handler (G_GNUC_UNUSED SoupServer        *soup_server,
         }
 
         /* Parse the actual XML message content */
-        doc = xmlRecoverMemory (msg->request_body->data,
-                                msg->request_body->length);
+        doc = xmlReadMemory (msg->request_body->data,
+                             msg->request_body->length,
+                             NULL,
+                             NULL,
+                             XML_PARSE_NONET | XML_PARSE_RECOVER);
         if (doc == NULL) {
                 /* Failed */
                 g_warning ("Failed to parse NOTIFY message body");
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index 67b3d43..0ebfb26 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -985,8 +985,11 @@ control_server_handler (SoupServer                      *server,
                 *end = '\0';
 
         /* Parse action_node */
-        doc = xmlRecoverMemory (msg->request_body->data,
-                                msg->request_body->length);
+        doc = xmlReadMemory (msg->request_body->data,
+                             msg->request_body->length,
+                             NULL,
+                             NULL,
+                             XML_PARSE_NONET | XML_PARSE_RECOVER);
         if (doc == NULL) {
                 soup_message_set_status (msg, SOUP_STATUS_BAD_REQUEST);