[sr-dev] git:master:6b23c27d: xmlrpc: user libxml function to get content of node if type not provided for param

Daniel-Constantin Mierla miconda at gmail.com
Tue May 3 17:01:18 CEST 2016


Module: kamailio
Branch: master
Commit: 6b23c27d8406780083a6b7bb774efa2a53aea540
URL: https://github.com/kamailio/kamailio/commit/6b23c27d8406780083a6b7bb774efa2a53aea540

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-05-03T16:59:06+02: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

---

Modified: modules/xmlrpc/xmlrpc.c

---

Diff:  https://github.com/kamailio/kamailio/commit/6b23c27d8406780083a6b7bb774efa2a53aea540.diff
Patch: https://github.com/kamailio/kamailio/commit/6b23c27d8406780083a6b7bb774efa2a53aea540.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