Explorar el Código

modules/sdpops: Check for valid sdp body in sdp_remove_line_by_prefix

- Fixes crash when used on requests with no body
Hugh Waite hace 12 años
padre
commit
771e9093e3
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      modules/sdpops/sdpops_mod.c

+ 5 - 0
modules/sdpops/sdpops_mod.c

@@ -373,6 +373,11 @@ int sdp_remove_line_by_prefix(sip_msg_t* msg, str* prefix)
 		return -1;
 		return -1;
 	}
 	}
 
 
+	if(msg->body == NULL) {
+		LM_DBG("No sdp body\n");
+		return -1;
+	}
+
 	body.s = ((sdp_info_t*)msg->body)->raw_sdp.s;
 	body.s = ((sdp_info_t*)msg->body)->raw_sdp.s;
 	body.len = ((sdp_info_t*)msg->body)->raw_sdp.len;
 	body.len = ((sdp_info_t*)msg->body)->raw_sdp.len;