Browse Source

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
Daniel-Constantin Mierla 9 years ago
parent
commit
6b23c27d84
1 changed files with 2 additions and 1 deletions
  1. 2 1
      modules/xmlrpc/xmlrpc.c

+ 2 - 1
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);