Skip to content

Commit

Permalink
mid_registrar: Fix a NULL pointer dereferencing bug
Browse files Browse the repository at this point in the history
Properly parse message headers before working on them

Fixes #1088
  • Loading branch information
liviuchircu committed Apr 3, 2017
1 parent 16cf1b5 commit ed5b390
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/mid_registrar/save.c
Expand Up @@ -2213,6 +2213,8 @@ int mid_reg_save(struct sip_msg *msg, char *dom, char *flags_gp,
parse_save_flags(&flags_str, &sctx);
}

parse_reg_headers(msg);

if (!to_uri_gp) {
to_uri = get_to(msg)->uri;
} else if (fixup_get_svalue(msg, (gparam_p)to_uri_gp, &to_uri)) {
Expand All @@ -2233,8 +2235,6 @@ int mid_reg_save(struct sip_msg *msg, char *dom, char *flags_gp,
return -1;
}

parse_reg_headers(msg);

if (check_contacts(msg, &st) > 0) {
goto out_error;
}
Expand Down

0 comments on commit ed5b390

Please sign in to comment.