From c5fcec8c3fe2fa82065aace4d20c6bc30a0f5783 Mon Sep 17 00:00:00 2001 From: Wang Fan Date: Wed, 3 Jan 2018 10:24:53 +0800 Subject: [PATCH] MdeModulePkg/DxeNetLib: Fix an error in packet length counting. * In old implementation, the operation len-- assumes AsciiSPrint() has counted NULL terminator, and it's not correct. This patch is to fix this issue. Cc: Fu Siyuan Cc: Ye Ting Cc: Jiaxin Wu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan Reviewed-by: Jiaxin Wu --- MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index 90f17b71b5..cbce28f1ba 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -403,7 +403,6 @@ SyslogBuildPacket ( Time.Minute, Time.Second ); - Len--; Len += (UINT32) AsciiSPrint ( Buf + Len, @@ -414,7 +413,7 @@ SyslogBuildPacket ( Line, File ); - Len--; + Len ++; // // OK, patch the IP length/checksum and UDP length fields. -- 2.39.2