[sr-dev] git:master:158ffa1d: cdp: b/f: Exit loop, if there is no avp->next (bug introduced in bac9707)

Carsten Bock carsten at ng-voice.com
Fri Jul 10 16:17:19 CEST 2015


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

Author: Carsten Bock <carsten at ng-voice.com>
Committer: Carsten Bock <carsten at ng-voice.com>
Date: 2015-07-10T16:17:06+02:00

cdp: b/f: Exit loop, if there is no avp->next (bug introduced in bac9707)

---

Modified: modules/cdp/peerstatemachine.c

---

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

---

diff --git a/modules/cdp/peerstatemachine.c b/modules/cdp/peerstatemachine.c
index 6434ae4..e0d2dbe 100644
--- a/modules/cdp/peerstatemachine.c
+++ b/modules/cdp/peerstatemachine.c
@@ -715,6 +715,8 @@ void save_peer_applications(peer *p,AAAMessage *msg)
 					vendor = get_4bytes(avp_vendor->data.s);
 					LM_DBG("Found Supported Vendor for Application %i: %i\n", DP_AUTHORIZATION, vendor);
 					add_peer_application(p,id,vendor,DP_AUTHORIZATION);
+					if (!avp_vendor->next)
+						break;
 					avp_vendor = AAAFindMatchingAVP(msg,avp_vendor->next,AVP_Supported_Vendor_Id,0,0);
 				}
 				break;
@@ -726,6 +728,8 @@ void save_peer_applications(peer *p,AAAMessage *msg)
 					vendor = get_4bytes(avp_vendor->data.s);
 					LM_DBG("Found Supported Vendor for Application %i: %i\n", DP_ACCOUNTING, vendor);
 					add_peer_application(p,id,vendor,DP_ACCOUNTING);
+					if (!avp_vendor->next)
+						break;
 					avp_vendor = AAAFindMatchingAVP(msg,avp_vendor->next,AVP_Supported_Vendor_Id,0,0);
 				}
 				break;




More information about the sr-dev mailing list