Browse code

rr: reset param buffer for r-r advertised address

- GH #2486

(cherry picked from commit 8dfc0f6ef0ddc4bf2d73d21124caa289d4b8ce07)

Daniel-Constantin Mierla authored on 30/09/2020 10:34:40 • Henning Westerholt committed on 02/10/2020 16:04:55
Showing 1 changed files
... ...
@@ -544,6 +544,11 @@ int record_route_preset(struct sip_msg* _m, str* _data)
544 544
 		from = get_from(_m);
545 545
 	}
546 546
 
547
+	if (rr_param_buf.len && rr_param_msg!=_m->id) {
548
+		/* rr_params were set for a different message -> reset buffer */
549
+		rr_param_buf.len = 0;
550
+	}
551
+
547 552
 	l = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, HDR_RECORDROUTE_T);
548 553
 	if (!l) {
549 554
 		LM_ERR("failed to create lump anchor\n");
... ...
@@ -807,6 +812,11 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data)
807 812
 		tag = 0;
808 813
 	}
809 814
 
815
+	if (rr_param_buf.len && rr_param_msg!=_m->id) {
816
+		/* rr_params were set for a different message -> reset buffer */
817
+		rr_param_buf.len = 0;
818
+	}
819
+
810 820
 	if(rr_ignore_sips==0) {
811 821
 		sips = rr_is_sips(_m);
812 822
 	}