[sr-dev] git:4.3:45060ef7: xmlrpc: user libxml function to get content of node if type not provided for param

Juha Heinanen jh at tutpro.com
Tue May 3 17:34:58 CEST 2016


Module: kamailio
Branch: 4.3
Commit: 45060ef72edf5fdac9376150e60d56ff9458e4ff
URL: https://github.com/kamailio/kamailio/commit/45060ef72edf5fdac9376150e60d56ff9458e4ff

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date: 2016-05-03T18:34:27+03:00

xmlrpc: user libxml function to get content of node if type not provided for param

- it is considered to be string according to specs
- old implementation was using the pointer inside the xmlNode struct,
  which may not be available later to free again by xmlrpc module
  garbage collector
- reported by Juha Heinanen

(cherry picked from commit 6b23c27d8406780083a6b7bb774efa2a53aea540)

---

Modified: modules/xmlrpc/xmlrpc.c

---

Diff:  https://github.com/kamailio/kamailio/commit/45060ef72edf5fdac9376150e60d56ff9458e4ff.diff
Patch: https://github.com/kamailio/kamailio/commit/45060ef72edf5fdac9376150e60d56ff9458e4ff.patch

---

diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c
index 8761c02..dabb526 100644
--- a/modules/xmlrpc/xmlrpc.c
+++ b/modules/xmlrpc/xmlrpc.c
@@ -1407,6 +1407,7 @@ static int get_string(char** val, struct xmlrpc_reply* reply,
 		return -1;
 	}
 	type=xml_get_type(dbl);
+	LM_DBG("xmrpc parameter type: %d\n", type);
 	switch(type){
 		case XML_T_STR:
 		case XML_T_TXT:
@@ -1423,7 +1424,7 @@ static int get_string(char** val, struct xmlrpc_reply* reply,
 			return -1;
 	}
 	if (type == XML_T_TXT)
-		val_str = (char*)dbl->content;
+		val_str = (char*)xmlNodeGetContent(dbl);
 	else
 		val_str = (char*)xmlNodeListGetString(doc, dbl->xmlChildrenNode, 1);
 




More information about the sr-dev mailing list