Browse code

pv: catch early setting $rU with empty string

- avoids backing up and restoring last char, which can create
inappropriate access when using static empty string value

(cherry picked from commit adf1bca4a820e9cb5fcc94a1953b0fcdbd8a20da)

Daniel-Constantin Mierla authored on 14/07/2015 15:40:05
Showing 1 changed files
... ...
@@ -2080,7 +2080,8 @@ int pv_set_ruri_user(struct sip_msg* msg, pv_param_t *param,
2080 2080
 		return -1;
2081 2081
 	}
2082 2082
 					
2083
-	if((val==NULL) || (val->flags&PV_VAL_NULL))
2083
+	if((val==NULL) || (val->flags&PV_VAL_NULL)
2084
+			|| ((val->flags&PV_VAL_STR) && val->rs.len<=0))
2084 2085
 	{
2085 2086
 		memset(&act, 0, sizeof(act));
2086 2087
 		act.type = SET_USER_T;