Skip to content

Commit

Permalink
dialog: correctly handle str2int return code (CID #150473)
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jul 10, 2020
1 parent e193172 commit babe782
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/dialog/dlg_handlers.c
Expand Up @@ -1973,10 +1973,11 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param)
if (req->first_line.u.request.method_value == METHOD_INVITE) {
/* we did not generate any pings yet - still we need to store the INV cseq,
in case there's a race between the ACK for the INVITE and sending of new pings */
/* coverity[check_return: FALSE]
* we are the ones that populated the cseq, it is 100% OK - CID #150473 */
str2int(&((struct cseq_body *)req->cseq->parsed)->number,
&dlg->legs[dst_leg].last_inv_gen_cseq);
if (str2int(&((struct cseq_body *)req->cseq->parsed)->number,
&dlg->legs[dst_leg].last_inv_gen_cseq) < 0)
LM_ERR("invalid INVITE cseq [%.*s]\n",
((struct cseq_body *)req->cseq->parsed)->number.len,
((struct cseq_body *)req->cseq->parsed)->number.s);
}

dlg_unlock( d_table, d_entry );
Expand Down

0 comments on commit babe782

Please sign in to comment.