Re: [edk2] [Patch] MdeModulePkg/DxeNetLib: Check the actual packet size before trim data from Nbuf.

2017-09-20 Thread Wu, Jiaxin
Hi Siyuan, Maybe we can add more check for the Len to return directly, what do you think? if (Len == 0) { return 0; } > + if (Nbuf->TotalSize == 0) { > +return 0; > + } Thanks, Jiaxin > -Original Message- > From: Fu, Siyuan > Sent: Wednesday, September 20, 2017 11:24 AM

[edk2] [Patch] MdeModulePkg/DxeNetLib: Check the actual packet size before trim data from Nbuf.

2017-09-19 Thread Fu Siyuan
In NetbufTrim() function, the NetBuf TotalSize should be checked with 0 before making the trim operation, otherwise the function will fall into infinite loop. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Cc: Wu Jiaxin