Browse code

path: set dst udp uri length for decoding received value in alias format

(cherry picked from commit f90640f7cec45a359e996493ae91b1a45d2603e7)
(cherry picked from commit 8d6c2b96e83fc58f7159957ea86d5f91c00808ba)

Daniel-Constantin Mierla authored on 30/03/2021 09:58:53 • Henning Westerholt committed on 22/10/2021 11:32:35
Showing 1 changed files
... ...
@@ -437,10 +437,13 @@ void path_rr_callback(struct sip_msg *_m, str *r_param, void *cb_param)
437 437
 						p += 10;
438 438
 						memcpy(p, sproto.s, sproto.len);
439 439
 						p += sproto.len;
440
-						*p = '\0';
441
-						dst_uri.len = p - dst_uri_buf;
442
-						break;
440
+					} else {
441
+						/* go back one byte to overwrite ';' */
442
+						p--;
443 443
 					}
444
+					*p = '\0';
445
+					dst_uri.len = p - dst_uri_buf;
446
+					break;
444 447
 				} else {
445 448
 					LM_ERR("invalid number of separators (%d)\n", n);
446 449
 					goto done;