Sfoglia il codice sorgente

ipops: avoid out of range index when sorting srv pv

Daniel-Constantin Mierla 8 anni fa
parent
commit
a473811c16
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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?