[sr-dev] git:master: modules_k/xcap_server: Fixed a segmentation fault in xcap_server

Peter Dunkley peter.dunkley at crocodile-rcs.com
Tue Apr 10 19:09:50 CEST 2012


Module: sip-router
Branch: master
Commit: a31826badd31529197c0bc70d329ec99e234698e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a31826badd31529197c0bc70d329ec99e234698e

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Tue Apr 10 17:58:37 2012 +0100

modules_k/xcap_server: Fixed a segmentation fault in xcap_server

- This occurs when you try to modify (with xpath) an XML document
  that does not exist on the server.

---

 modules_k/xcap_server/xcap_server.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules_k/xcap_server/xcap_server.c b/modules_k/xcap_server/xcap_server.c
index ff25967..7b44585 100644
--- a/modules_k/xcap_server/xcap_server.c
+++ b/modules_k/xcap_server/xcap_server.c
@@ -576,7 +576,7 @@ static int w_xcaps_put(sip_msg_t* msg, char* puri, char* ppath,
 		/* partial document upload
 		 *   - fetch, update, delete and store
 		 */
-		if(xcaps_get_db_doc(&turi.user, &turi.host, &xuri, &tbuf)<0)
+		if(xcaps_get_db_doc(&turi.user, &turi.host, &xuri, &tbuf) != 0)
 		{
 			LM_ERR("could not fetch xcap document\n");
 			goto error;
@@ -1092,7 +1092,7 @@ static int w_xcaps_del(sip_msg_t* msg, char* puri, char* ppath)
 				&xcaps_str_empty, &xcaps_str_empty);
 	} else {
 		/* delete element */
-		if(xcaps_get_db_doc(&turi.user, &turi.host, &xuri, &tbuf)<0)
+		if(xcaps_get_db_doc(&turi.user, &turi.host, &xuri, &tbuf) != 0)
 		{
 			LM_ERR("could not fetch xcap document\n");
 			goto error;




More information about the sr-dev mailing list