Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15888
6f19259b-4bc3-4df7-8a09-
765794883524
if (Packet->OpCode == EFI_MTFTP4_OPCODE_ERROR) {\r
Private->Mode.TftpErrorReceived = TRUE;\r
Private->Mode.TftpError.ErrorCode = (UINT8) Packet->Error.ErrorCode;\r
if (Packet->OpCode == EFI_MTFTP4_OPCODE_ERROR) {\r
Private->Mode.TftpErrorReceived = TRUE;\r
Private->Mode.TftpError.ErrorCode = (UINT8) Packet->Error.ErrorCode;\r
- AsciiStrnCpy (Private->Mode.TftpError.ErrorString, (CHAR8 *) Packet->Error.ErrorMessage, 127);\r
+ AsciiStrnCpy (Private->Mode.TftpError.ErrorString, (CHAR8 *) Packet->Error.ErrorMessage, PXE_MTFTP_ERROR_STRING_LENGTH);\r
+ Private->Mode.TftpError.ErrorString[PXE_MTFTP_ERROR_STRING_LENGTH - 1] = '\0';\r
}\r
\r
if (Callback != NULL) {\r
}\r
\r
if (Callback != NULL) {\r
AsciiStrnCpy (\r
Private->Mode.TftpError.ErrorString, \r
(CHAR8 *) Packet->Error.ErrorMessage, \r
AsciiStrnCpy (\r
Private->Mode.TftpError.ErrorString, \r
(CHAR8 *) Packet->Error.ErrorMessage, \r
+ PXE_MTFTP_ERROR_STRING_LENGTH\r
+ Private->Mode.TftpError.ErrorString[PXE_MTFTP_ERROR_STRING_LENGTH - 1] = '\0';\r
/** @file\r
Mtftp routines for PxeBc.\r
\r
/** @file\r
Mtftp routines for PxeBc.\r
\r
-Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#define PXE_MTFTP_OPTION_MULTICAST_INDEX 3\r
#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4\r
\r
#define PXE_MTFTP_OPTION_MULTICAST_INDEX 3\r
#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4\r
\r
+#define PXE_MTFTP_ERROR_STRING_LENGTH 127\r
+\r
\r
/**\r
This function is to get size of a file by Tftp.\r
\r
/**\r
This function is to get size of a file by Tftp.\r
/** @file\r
The implementation of construct ENTRY_INDEXER in IpSecConfig application.\r
\r
/** @file\r
The implementation of construct ENTRY_INDEXER in IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
Indexer->PadId.PeerIdValid = TRUE;\r
}\r
\r
Indexer->PadId.PeerIdValid = TRUE;\r
+ ZeroMem (Indexer->PadId.Id.PeerId, MAX_PEERID_LEN);\r
StrnCpy ((CHAR16 *) Indexer->PadId.Id.PeerId, ValueStr, ARRAY_SIZE (Indexer->PadId.Id.PeerId) - 1);\r
}\r
}\r
StrnCpy ((CHAR16 *) Indexer->PadId.Id.PeerId, ValueStr, ARRAY_SIZE (Indexer->PadId.Id.PeerId) - 1);\r
}\r
}\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
+ Private->Mode.TftpError.ErrorString[PXE_MTFTP_ERROR_STRING_LENGTH - 1] = '\0';\r
}\r
\r
if (Callback != NULL) {\r
}\r
\r
if (Callback != NULL) {\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
+ Private->Mode.TftpError.ErrorString[PXE_MTFTP_ERROR_STRING_LENGTH - 1] = '\0';\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
+ Private->Mode.TftpError.ErrorString[PXE_MTFTP_ERROR_STRING_LENGTH - 1] = '\0';\r
}\r
\r
if (Callback != NULL) {\r
}\r
\r
if (Callback != NULL) {\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
(CHAR8 *) Packet->Error.ErrorMessage,\r
PXE_MTFTP_ERROR_STRING_LENGTH\r
);\r
+ Private->Mode.TftpError.ErrorString[PXE_MTFTP_ERROR_STRING_LENGTH - 1] = '\0';\r