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 <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
cf4a8fa455
commit
c5fcec8c3f
|
@ -403,7 +403,6 @@ SyslogBuildPacket (
|
||||||
Time.Minute,
|
Time.Minute,
|
||||||
Time.Second
|
Time.Second
|
||||||
);
|
);
|
||||||
Len--;
|
|
||||||
|
|
||||||
Len += (UINT32) AsciiSPrint (
|
Len += (UINT32) AsciiSPrint (
|
||||||
Buf + Len,
|
Buf + Len,
|
||||||
|
@ -414,7 +413,7 @@ SyslogBuildPacket (
|
||||||
Line,
|
Line,
|
||||||
File
|
File
|
||||||
);
|
);
|
||||||
Len--;
|
Len ++;
|
||||||
|
|
||||||
//
|
//
|
||||||
// OK, patch the IP length/checksum and UDP length fields.
|
// OK, patch the IP length/checksum and UDP length fields.
|
||||||
|
|
Loading…
Reference in New Issue