[sr-dev] git:master:44fdac69: carrierroute: fix failureroute db_load_description

Lucian Balaceanu lucian.balaceanu at 1and1.ro
Wed Nov 18 12:52:12 CET 2015


Module: kamailio
Branch: master
Commit: 44fdac69eb864125b4d02af0c650ce735dcf7aa8
URL: https://github.com/kamailio/kamailio/commit/44fdac69eb864125b4d02af0c650ce735dcf7aa8

Author: Lucian Balaceanu <lucian.balaceanu at 1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu at 1and1.ro>
Date: 2015-11-18T13:45:34+02:00

carrierroute: fix failureroute db_load_description

- safeguarding shm_str_dup call in add_failure_route_rule function

---

Modified: modules/carrierroute/cr_rule.c

---

Diff:  https://github.com/kamailio/kamailio/commit/44fdac69eb864125b4d02af0c650ce735dcf7aa8.diff
Patch: https://github.com/kamailio/kamailio/commit/44fdac69eb864125b4d02af0c650ce735dcf7aa8.patch

---

diff --git a/modules/carrierroute/cr_rule.c b/modules/carrierroute/cr_rule.c
index a9e6bba..fa3e8ee 100644
--- a/modules/carrierroute/cr_rule.c
+++ b/modules/carrierroute/cr_rule.c
@@ -360,7 +360,7 @@ struct failure_route_rule *add_failure_route_rule(struct failure_route_rule **fr
 	shm_frr->mask = mask;
 	shm_frr->next_domain = next_domain;
 	
-	if (shm_str_dup(&shm_frr->comment, comment) != 0) {
+	if (comment && shm_str_dup(&shm_frr->comment, comment) != 0) {
 		goto mem_error;
 	}
 	




More information about the sr-dev mailing list