Browse code

ipops: avoid out of range index when sorting srv pv

Daniel-Constantin Mierla authored on 30/01/2017 16:28:59
Showing 1 changed files
... ...
@@ -829,7 +829,7 @@ void sort_srv (struct srv_rdata **plist, int rcount)
829 829
 
830 830
 	idx2 = 0;
831 831
 	pswap = plist [0];
832
-	for (idx1 = 1; idx1 <= rcount; idx1++) {
832
+	for (idx1 = 1; idx1 < rcount; idx1++) {
833 833
 		if ((idx1 == rcount) || (pswap->priority != plist [idx1]->priority)) {
834 834
 			/**********
835 835
 			 * o range has more than one element?