NetworkPkg:Replace unsafe string functions.

Replace unsafe string functions with new added safe string functions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17887 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Zhang Lubo
2015-07-08 12:17:11 +00:00
committed by luobozhang
parent e0f74cea66
commit c960bdc2dc
12 changed files with 59 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of policy entry operation function in IpSecConfig application.
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -1104,7 +1104,7 @@ CreatePadEntry (
ValueStr = ShellCommandLineGetValue (ParamPackage, L"--peer-id");
if (ValueStr != NULL) {
(*PadId)->PeerIdValid = TRUE;
StrnCpy ((CHAR16 *) (*PadId)->Id.PeerId, ValueStr, ARRAY_SIZE ((*PadId)->Id.PeerId) - 1);
StrnCpyS ((CHAR16 *) (*PadId)->Id.PeerId, MAX_PEERID_LEN / sizeof (CHAR16), ValueStr, MAX_PEERID_LEN / sizeof (CHAR16) - 1);
*Mask |= PEER_ID;
}
@@ -1399,7 +1399,7 @@ CombineSpdEntry (
// Process Data
//
if ((Mask & NAME) != 0) {
AsciiStrCpy ((CHAR8 *) OldData->Name, (CHAR8 *) NewData->Name);
AsciiStrCpyS ((CHAR8 *) OldData->Name, MAX_PEERID_LEN, (CHAR8 *) NewData->Name);
}
if ((Mask & PACKET_FLAG) != 0) {