[sr-dev] git:master:f36d8096: Merge pull request #719 from vingarzan/openimsrevamp_cdp_fixes

GitHub noreply at github.com
Wed Jul 20 20:26:20 CEST 2016


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

Author: ng-voice GmbH <info at ng-voice.com>
Committer: GitHub <noreply at github.com>
Date: 2016-07-20T20:26:13+02:00

Merge pull request #719 from vingarzan/openimsrevamp_cdp_fixes

cdp: initializing a variable to 0 and checking a return ptr for null

---

Modified: modules/cdp/authstatemachine.c
Modified: modules/cdp/peermanager.c

---

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

---

diff --git a/modules/cdp/authstatemachine.c b/modules/cdp/authstatemachine.c
index b479080..203dfef 100644
--- a/modules/cdp/authstatemachine.c
+++ b/modules/cdp/authstatemachine.c
@@ -754,12 +754,14 @@ void Send_ASA(cdp_session_t* s, AAAMessage* msg) {
 			// the PCRF because TS 29.214 says no Destination-Host and no Auth-Application-Id
 			// in the ASA
 			LM_INFO("sending ASA to peer %.*s\n", avp->data.len, avp->data.s);
-			peer *p;
-			p = get_peer_by_fqdn(&avp->data);
-			if (!peer_send_msg(p, asa)) {
+			peer *p = get_peer_by_fqdn(&avp->data);
+			if (!p) {
+				LM_ERR("Peer not found\n");
+			}else if (!peer_send_msg(p, asa)) {
 				if (asa) AAAFreeMessage(&asa); //needed in frequency
-			} else
+			} else {
 				LM_INFO("success sending ASA\n");
+			}
 		} else if (!AAASendMessage(asa, 0, 0)) {
 			LM_ERR("Send_ASA() : error sending ASA\n");
 		}
diff --git a/modules/cdp/peermanager.c b/modules/cdp/peermanager.c
index bce1c0e..1d6f6a9 100644
--- a/modules/cdp/peermanager.c
+++ b/modules/cdp/peermanager.c
@@ -209,7 +209,7 @@ peer *get_peer_from_sock(int sock)
 peer *get_peer_from_fqdn(str fqdn,str realm)
 {
 	peer *i;
-	str dumb;
+	str dumb = {0,0};
 
 	lock_get(peer_list_lock);
 	i = peer_list->head;




More information about the sr-dev mailing list