[sr-dev] git:master:8b0a42ab: rr: use macro to get parsed From in record_route_preset()

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 3 10:03:32 CEST 2017


Module: kamailio
Branch: master
Commit: 8b0a42ab64c02a1fa253ce156442bab64a4fe3db
URL: https://github.com/kamailio/kamailio/commit/8b0a42ab64c02a1fa253ce156442bab64a4fe3db

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/8b0a42ab64c02a1fa253ce156442bab64a4fe3db.diff
Patch: https://github.com/kamailio/kamailio/commit/8b0a42ab64c02a1fa253ce156442bab64a4fe3db.patch

---

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);




More information about the sr-dev mailing list