Skip to content

Commit

Permalink
xmlrpc: user libxml function to get content of node if type not provi…
Browse files Browse the repository at this point in the history
…ded 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 6b23c27)
  • Loading branch information
miconda authored and juha-h committed May 3, 2016
1 parent da6e525 commit 45060ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/xmlrpc/xmlrpc.c
Expand Up @@ -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:
Expand All @@ -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);

Expand Down

0 comments on commit 45060ef

Please sign in to comment.