Browse Source

modules_k/xcap_server: Fixed segmentation fault

- Occurs when attempting to do an etag compare when there is no document/etag
  in the database.
Peter Dunkley 13 years ago
parent
commit
d29cfab158
1 changed files with 6 additions and 0 deletions
  1. 6 0
      modules_k/xcap_server/xcap_server.c

+ 6 - 0
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;