Skip to content

Commit 23e905e

Browse files
committed
fix rewrite_ruri() + RW_RURI_PREFIX with empty string prefix
If an empty string prefix was provided, a malformed URI was generated (like "sip:@host.com") Reported by @thuroc and @FlyingDutchfrog Fixes #3691 (cherry picked from commit 4ddb8f0)
1 parent b11fad8 commit 23e905e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

parser/msg_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ int rewrite_ruri(struct sip_msg *msg, str *sval, int ival,
12311231
if (crt+len>end) goto error;
12321232
memcpy(crt,tmp,len);crt+=len;
12331233

1234-
if (part==RW_RURI_PREFIX) {
1234+
if (part==RW_RURI_PREFIX && sval->len) {
12351235
if (crt+sval->len>end) goto error;
12361236
memcpy( crt, sval->s, sval->len);
12371237
crt+=sval->len;

0 commit comments

Comments
 (0)