[sr-dev] git:master:a473811c: ipops: avoid out of range index when sorting srv pv

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 30 17:29:58 CET 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-01-30T17:28:59+01:00

ipops: avoid out of range index when sorting srv pv

---

Modified: src/modules/ipops/ipops_pv.c

---

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

---

diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index b522bb2..a0f4d24 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -829,7 +829,7 @@ void sort_srv (struct srv_rdata **plist, int rcount)
 
 	idx2 = 0;
 	pswap = plist [0];
-	for (idx1 = 1; idx1 <= rcount; idx1++) {
+	for (idx1 = 1; idx1 < rcount; idx1++) {
 		if ((idx1 == rcount) || (pswap->priority != plist [idx1]->priority)) {
 			/**********
 			 * o range has more than one element?




More information about the sr-dev mailing list