The change doesn't impact the functionality.

Cc: Ruiyu Ni <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <[email protected]>
---
 BaseTools/Source/C/Common/CommonLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/Common/CommonLib.c 
b/BaseTools/Source/C/Common/CommonLib.c
index 90cc578e61..0e9aaa3735 100644
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ b/BaseTools/Source/C/Common/CommonLib.c
@@ -2032,8 +2032,8 @@ StrToIpv6Address (
     return RETURN_UNSUPPORTED;
   }
   memcpy (&Address->Addr[0], &LocalAddress.Addr[0], CompressStart);
-  memset (&Address->Addr[CompressStart], 0,  ARRAY_SIZE (Address->Addr) - 
AddressIndex);
   if (AddressIndex > CompressStart) {
+    memset (&Address->Addr[CompressStart], 0,  ARRAY_SIZE (Address->Addr) - 
AddressIndex);
     memcpy (
       &Address->Addr[CompressStart + ARRAY_SIZE (Address->Addr) - 
AddressIndex],
       &LocalAddress.Addr[CompressStart],
-- 
2.12.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to