File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -176,22 +176,26 @@ FnIoGetFilteredFrame(
176176 }
177177
178178 NetBuffer = NET_BUFFER_LIST_FIRST_NB (Nbl );
179+ ASSERT (NetBuffer != NULL );
179180
180- for (UINT32 NbIndex = 0 ; NbIndex < SubIndex ; NbIndex ++ ) {
181- if (NetBuffer == NULL ) {
182- Status = STATUS_NOT_FOUND ;
183- goto Exit ;
184- }
185-
181+ do {
186182 //
187183 // Only count NBs that match the filter.
188184 //
189- if (!FnIoFilterNb (Filter , NetBuffer )) {
190- NbIndex -- ;
185+ if (FnIoFilterNb (Filter , NetBuffer )) {
186+ if (SubIndex == 0 ) {
187+ break ;
188+ } else {
189+ SubIndex -- ;
190+ }
191191 }
192192
193193 NetBuffer = NetBuffer -> Next ;
194- }
194+ if (NetBuffer == NULL ) {
195+ Status = STATUS_NOT_FOUND ;
196+ goto Exit ;
197+ }
198+ } while (TRUE);
195199
196200 BufferCount = 0 ;
197201 OutputSize = sizeof (* Frame );
Original file line number Diff line number Diff line change @@ -639,13 +639,13 @@ BasicTx()
639639 BOOLEAN Uso = TRUE ;
640640
641641 UCHAR UdpPayload[] = " BasicTx0BasicTx1" ;
642- UCHAR Pattern[UDP_HEADER_BACKFILL (AF_INET) + ( sizeof (UdpPayload) - 1 ) / 2 ];
642+ UCHAR Pattern[UDP_HEADER_BACKFILL (AF_INET) + sizeof (UdpPayload) / 2 - 1 ];
643643 UCHAR Mask[sizeof (Pattern)];
644644 UINT32 ExpectedUdpPayloadSize = sizeof (UdpPayload) / 2 ;
645645 UINT32 SendSize = sizeof (UdpPayload);
646646
647647 RtlZeroMemory (Pattern, sizeof (Pattern));
648- RtlCopyMemory (Pattern + UDP_HEADER_BACKFILL (AF_INET), UdpPayload, ( sizeof (UdpPayload) - 1 ) / 2 );
648+ RtlCopyMemory (Pattern + UDP_HEADER_BACKFILL (AF_INET), UdpPayload, sizeof (UdpPayload) / 2 - 1 );
649649
650650 RtlZeroMemory (Mask, sizeof (Mask));
651651 for (int i = UDP_HEADER_BACKFILL (AF_INET); i < sizeof (Mask); i++) {
You can’t perform that action at this time.
0 commit comments