Module: sip-router
Branch: master
Commit: d29cfab1584b8bc2672b4242a2626d9dc90c77a2
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d29cfab…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)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.
---
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;