Skip to content

Commit

Permalink
mid_registrar: fix possible crash for REGISTER messages without contact
Browse files Browse the repository at this point in the history
Fixes Coverity CID #163986
  • Loading branch information
razvancrainea committed Mar 9, 2017
1 parent fda5484 commit 8f5572b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/mid_registrar/save.c
Original file line number Diff line number Diff line change
Expand Up @@ -2236,11 +2236,9 @@ int mid_reg_save(struct sip_msg *msg, char *dom, char *flags_gp,
}

if (get_first_contact(msg) == NULL) {
if (st) {
if (st)
sctx.star = 1;
return prepare_forward(msg, ud, &sctx.aor, &sctx);
}
goto quick_reply;
return prepare_forward(msg, ud, &sctx.aor, &sctx);
}

/* in mirror mode, all REGISTER requests simply pass through */
Expand All @@ -2265,7 +2263,6 @@ int mid_reg_save(struct sip_msg *msg, char *dom, char *flags_gp,
else if (rc == 1)
goto out_forward;

quick_reply:
/* forwarding not needed! This REGISTER will be absorbed */

/* prepare the Contact header field for a quick 200 OK response */
Expand Down

0 comments on commit 8f5572b

Please sign in to comment.