Browse code

core: use third array element when generating totag suffix

Charles Chance authored on 29/03/2021 20:43:30
Showing 1 changed files
... ...
@@ -51,17 +51,18 @@ static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix)
51 51
 	suffix_source[0]=msg->via1->host;
52 52
 	suffix_source[1]=msg->via1->port_str;
53 53
 	if (msg->via1->branch) {
54
-		suffix_source[2]=msg->via1->branch->value;
54
+		suffix_source[ss_nr++]=msg->via1->branch->value;
55 55
 	} else {
56 56
 		suffix_source[2].s = NULL;
57 57
 		suffix_source[2].len = 0;
58 58
 	}
59 59
 	crcitt_string_array( tag_suffix, suffix_source, ss_nr );
60 60
 
61
+	ss_nr=2;
61 62
 	suffix_source[0]=msg->via1->port_str;
62 63
 	suffix_source[1]=msg->via1->host;
63 64
 	if (msg->callid) {
64
-		suffix_source[2]=msg->callid->body;
65
+		suffix_source[ss_nr++]=msg->callid->body;
65 66
 	} else {
66 67
 		suffix_source[2].s = NULL;
67 68
 		suffix_source[2].len = 0;