From 1d6736d16ab3a83b77d6c7be3f9689c7fbfccf28 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 26 Apr 2021 13:49:42 +0200 Subject: [PATCH] topos: restore checks on uri and sip_params for tps_dlg_message_update() - use define for expected min len safety checks --- src/modules/topos/tps_msg.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c index cbf8b3c9f3c..852a19aaa21 100644 --- a/src/modules/topos/tps_msg.c +++ b/src/modules/topos/tps_msg.c @@ -309,17 +309,18 @@ int tps_dlg_message_update(sip_msg_t *msg, tps_data_t *ptsd, int ctmode) str tuuid = STR_NULL; int ret; +#define TPS_TUUID_MIN_LEN 10 + if(parse_sip_msg_uri(msg)<0) { LM_ERR("failed to parse r-uri\n"); return -1; } - if(msg->parsed_uri.sip_params.len<10) { - LM_DBG("not an expected %s format\n", (ctmode==0)?"user":"param"); - return 1; - } - if (ctmode == 1 || ctmode == 2) { + if(msg->parsed_uri.sip_params.lenparsed_uri.params, &_tps_cparam_name, &tuuid); @@ -332,6 +333,10 @@ int tps_dlg_message_update(sip_msg_t *msg, tps_data_t *ptsd, int ctmode) return 1; } } else { + if(msg->parsed_uri.user.lenparsed_uri.user; }