[sr-dev] git:3.3: modules_k/xcap_server: Fixed segmentation fault

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Oct 10 11:50:54 CEST 2012


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

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Tue Oct  9 21:07:10 2012 +0100

modules_k/xcap_server: Fixed segmentation fault

- Occurs when attempting to do an etag compare when there is no document/etag
  in the database.
(cherry picked from commit d29cfab1584b8bc2672b4242a2626d9dc90c77a2)

---

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

diff --git a/modules_k/xcap_server/xcap_server.c b/modules_k/xcap_server/xcap_server.c
index 7b44585..0d68bb0 100644
--- a/modules_k/xcap_server/xcap_server.c
+++ b/modules_k/xcap_server/xcap_server.c
@@ -1339,6 +1339,12 @@ static int check_preconditions(sip_msg_t *msg, str etag_hdr)
 
 static int check_match_header(str body, str *etag)
 {
+	if (etag == NULL)
+		return -1;
+
+	if (etag->s || etag->len == 0)
+		return -1;
+
 	do
 	{
 		char *start_pos, *end_pos, *old_body_pos;




More information about the sr-dev mailing list