Преглед изворни кода

ipops: avoid out of range index when sorting srv pv

Daniel-Constantin Mierla пре 8 година
родитељ
комит
a473811c16
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/modules/ipops/ipops_pv.c

+ 1 - 1
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?