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

Daniel-Constantin Mierla authored on 14/07/2015 15:40:05
Showing 1 changed files
... ...
@@ -2092,7 +2092,8 @@ int pv_set_ruri_user(struct sip_msg* msg, pv_param_t *param,
2092 2092
 		return -1;
2093 2093
 	}
2094 2094
 					
2095
-	if((val==NULL) || (val->flags&PV_VAL_NULL))
2095
+	if((val==NULL) || (val->flags&PV_VAL_NULL)
2096
+			|| ((val->flags&PV_VAL_STR) && val->rs.len<=0))
2096 2097
 	{
2097 2098
 		memset(&act, 0, sizeof(act));
2098 2099
 		act.type = SET_USER_T;