Module: kamailio
Branch: master
Commit: 8b0a42ab64c02a1fa253ce156442bab64a4fe3db
URL:
https://github.com/kamailio/kamailio/commit/8b0a42ab64c02a1fa253ce156442bab…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-03T10:03:18+02:00
rr: use macro to get parsed From in record_route_preset()
- safety check for parsed pointer
---
Modified: src/modules/rr/record.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8b0a42ab64c02a1fa253ce156442bab…
Patch:
https://github.com/kamailio/kamailio/commit/8b0a42ab64c02a1fa253ce156442bab…
---
diff --git a/src/modules/rr/record.c b/src/modules/rr/record.c
index df7f95553d..0d042b2d36 100644
--- a/src/modules/rr/record.c
+++ b/src/modules/rr/record.c
@@ -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);