/** @file\r
Common basic Library Functions\r
\r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, 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
//\r
// Construct the full file path\r
//\r
- strcat (mCommonLibFullPath, FileName);\r
+ if (strlen (mCommonLibFullPath) + strlen (FileName) > MAX_LONG_FILE_PATH - 1) {\r
+ Error (NULL, 0, 2000, "Invalid parameter", "FileName %s is too long!", FileName);\r
+ return NULL;\r
+ }\r
+ strncat (mCommonLibFullPath, FileName, MAX_LONG_FILE_PATH - strlen (mCommonLibFullPath) - 1);\r
\r
//\r
// Convert directory separator '/' to '\\'\r
Decompressor. Algorithm Ported from OPSD code (Decomp.asm) for Efi and Tiano \r
compress algorithm.\r
\r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, 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
\r
#include <stdlib.h>\r
#include <string.h>\r
+#include <assert.h>\r
#include "Decompress.h"\r
\r
//\r
for (Char = 0; Char < NumOfChar; Char++) {\r
\r
Len = BitLen[Char];\r
- if (Len == 0) {\r
+ if (Len == 0 || Len >= 17) {\r
continue;\r
}\r
\r
UINT16 Index;\r
UINT32 Mask;\r
\r
+ assert (nn <= NPT);\r
+\r
Number = (UINT16) GetBits (Sd, nbit);\r
\r
if (Number == 0) {\r