Skip to content

Commit

Permalink
rr: use macro to get parsed From in record_route_preset()
Browse files Browse the repository at this point in the history
- safety check for parsed pointer

(cherry picked from commit 8b0a42a)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent e92b6ec commit 3ba4cc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/rr/record.c
Expand Up @@ -529,12 +529,12 @@ int record_route_preset(struct sip_msg* _m, str* _data)
}

if (append_fromtag) {
if (parse_from_header(_m) < 0) {
if (parse_from_header(_m) < 0 || get_from(_m)==NULL) {
LM_ERR("From parsing failed\n");
ret = -2;
goto error;
}
from = (struct to_body*)_m->from->parsed;
from = get_from(_m);
}

l = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, HDR_RECORDROUTE_T);
Expand Down

0 comments on commit 3ba4cc6

Please sign in to comment.