Skip to content

Commit 5ebc1ef

Browse files
committed
Allow variables to be assigned variables containing NULL values
1 parent 84cfab2 commit 5ebc1ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

action.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ int do_assign(struct sip_msg* msg, struct action* a)
239239
if(a->elem[1].type != NULLV_ST)
240240
{
241241
ret = eval_expr((struct expr*)a->elem[1].u.data, msg, &val);
242-
if(!((val.flags&PV_VAL_STR)||(val.flags&PV_VAL_INT))) {
242+
if(!(val.flags & (PV_VAL_STR | PV_VAL_INT | PV_VAL_NULL)))
243+
{
243244
LM_WARN("no value in right expression on line %d\n",a->line);
244245
goto error2;
245246
}
@@ -268,7 +269,7 @@ int do_assign(struct sip_msg* msg, struct action* a)
268269
(unsigned char)a->type == BOREQ_T ? "b-or-eq":"b-xor-eq",
269270
msg, a->line);
270271

271-
if(a->elem[1].type == NULLV_ST)
272+
if(a->elem[1].type == NULLV_ST || (val.flags & PV_VAL_NULL))
272273
{
273274
if(pv_set_value(msg, dspec, (int)a->type, 0)<0)
274275
{

0 commit comments

Comments
 (0)