Skip to content

Commit

Permalink
next_branches(): Fix infinite looping during error handling
Browse files Browse the repository at this point in the history
If someone has actually taken the time to corrupt the internal
"$avp(serial_branch)" AVP, do not perform the "infinite while loop dance"
and correctly progress to the next AVP.

(cherry picked from commit 244cc92)
  • Loading branch information
liviuchircu committed Nov 17, 2022
1 parent e5739be commit 7938123
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ int next_branches( struct sip_msg *msg)

if (!val.s.s) {
LM_ERR("invalid avp value\n");
continue;
goto next_avp;
}

p = val.s.s;
Expand Down Expand Up @@ -389,6 +389,7 @@ int next_branches( struct sip_msg *msg)
goto error1;
}

next_avp:
last_parallel_fork = (avp->flags & Q_FLAG);
prev = avp;
avp = search_next_avp(avp, &val);
Expand Down

0 comments on commit 7938123

Please sign in to comment.