From: Jeffrey Altman Date: Tue, 10 Feb 2009 22:42:40 +0000 (+0000) Subject: fix-tsfpq-20090210 X-Git-Tag: openafs-devel-1_5_61~532 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1050049411d1fc47441220c33e6353436fc586e7;p=packages%2Fo%2Fopenafs.git fix-tsfpq-20090210 LICENSE BSD avoid transferring more than the number of packets in a queue --- diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index b134cd3d5..3ea679b61 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -299,7 +299,7 @@ void rxi_FlushLocalPacketsTSFPQ(void); /* flush all thread-local packets to glob do { \ int i; \ struct rx_packet * p; \ - int tsize = (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize; \ + int tsize = MIN((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ if (tsize <= 0) break; \ for (i=0,p=queue_Last(&((rx_ts_info_p)->_FPQ), rx_packet); \ i < tsize; i++,p=queue_Prev(p, rx_packet)); \