Commit Graph

23257 Commits

Author SHA1 Message Date
Long Qin 4a75acbed3 CryptoPkg: Remove Cryptest Application from CryptoPkg
BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=819
Remove Cryptest application from CryptoPkg, which was only for
unit test.

Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2017-12-27 02:32:13 +08:00
Long Qin b6ee737979 SecurityPkg: Remove RngTest Application from SecurityPkg
BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=820
Remove the RngTest application from SecurityPkg, which was only for
unit test.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
2017-12-27 02:29:00 +08:00
Long Qin dce03c46aa CryptoPkg/OpensslLib: Update OpenSSL version to 1.1.0g
Update the supported OpenSSL version to the latest 1.1.0g (02-Nov-2017).
The changes includes:
 - Re-generate the OpensslLib[crypto].inf using process_files.pl script
   to reflect the openssl source changes.
 - Update OpenSSL-HOWTO.txt
 - On Visual Studio Build: adding "/wd4819" to disable one addition build
   warning issue, which was already fixed in OpenSSL-HEAD
   https://github.com/openssl/openssl/pull/4691.
 - On GCC Build: openssl-1.1.0g introduced one additional build warning:
    ...\openssl\crypto\asn1\x_int64.c:105:32: error: format '%ld' expects
        argument of type 'long int', but argument 3 has type 'int64_t
        {aka long long int}' [-Werror=format=]
    return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
                                ^
    Adding "-Wno-error=format" to GCC build flag to suppress this warning,
    since we have no real printf usage in BaseCryptLib, and BIO_printf()
    was already wrappered as the dummy implementation in CryptoPkg.

Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2017-12-27 02:18:08 +08:00
Jian J Wang c44218e5f4 MdeModulePkg/Core: Fix heap guard issues
Three issues addressed here:

a. Make NX memory protection and heap guard to be compatible
The solution is to check PcdDxeNxMemoryProtectionPolicy in Heap Guard to
see if the free memory should be set to NX, and set the Guard page to NX
before it's freed back to memory pool. This can solve the issue which NX
setting would be overwritten by Heap Guard feature in certain
configuration.

b. Returned pool address was not 8-byte aligned sometimes
This happened only when BIT7 is not set in PcdHeapGuardPropertyMask. Since
8-byte alignment is UEFI spec required, letting allocated pool adjacent to
tail guard page cannot be guaranteed.

c. NULL address handling due to allocation failure
When allocation failure, normally a NULL will be returned. But Heap Guard
code will still try to adjust the starting address of it, which will cause
a non-NULL pointer returned.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-26 18:07:27 +08:00
Liming Gao 14b351e2ed MdeModulePkg HiiDataBaseDxe: Add the check for the memory allocation return
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-26 17:46:31 +08:00
Liming Gao 1b79547a91 MdeModulePkg Variable: Update Pointer Minus with UINTN type
In V2, reduce unnecessary () in the expression.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-12-26 17:46:30 +08:00
Jiaxin Wu 1697754b7e NetworkPkg/TcpDxe: Remove the redundant code.
The function SockGroup() is not used by any other code. So,
it can be deleted.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wang Fan <fan.wang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-26 16:43:29 +08:00
Jiaxin Wu 8b40f01a3f NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use
According the Spec, the FragmentBuffers in FragmentTable are allocated
by the application when calling Receive() function. This patch is to
check whether the FragmentBuffer is valid or not.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wang Fan <fan.wang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-26 16:43:24 +08:00
Feng, Bob C 5644e5cece BaseTools: Fix building FatPkg failed issue
Using property instead of vairable for DecPcds.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-26 11:41:34 +08:00
zwei4 2ec099da13 Fix License Header.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wei, David <david.wei@intel.com>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Wu, Mike <mike.wu@intel.com>
2017-12-26 11:06:01 +08:00
Jian J Wang 56649f4301 UefiCpuPkg: Update code to use new structure field names
Due to coding style fix of the structure definition in BaseLib.h, all
code referencing those structure must be updated accordingly.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2017-12-26 09:44:14 +08:00
Jian J Wang 5e2ee2f5f4 UefiCpuPkg/UefiCpuPkg.uni: Add missing string definition for new PCDs
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2017-12-26 09:44:14 +08:00
Jian J Wang 9db7e9fd97 MdeModulePkg/Core: Coding style clean-up
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-26 09:44:14 +08:00
Jian J Wang 47595ac0b9 MdePkg/BaseLib.h: Coding style clean-up
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2017-12-26 09:44:13 +08:00
Wang Fan c5738e3c81 MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2017-12-26 09:04:40 +08:00
Liming Gao 718b6fe9a3 MdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference
Make VS2012x86 and GCC48 pass build

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-12-25 18:47:15 +08:00
Liming Gao 7c73626513 MdeModulePkg: Update PCD driver to support the optimized PcdDataBase
https://bugzilla.tianocore.org/show_bug.cgi?id=546
BaseTools will generate the optimized PCD database to save the image size
at build time for multiple SKUs. The optimized PCD database layout will be like
below, the PCD database will be composed of the full default SKU data
(PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA).
PCD driver will build HOB to store the full default SKU data, and patch HOB
data based on non-default SKU delta data for the SKU set by SetSku(),
it can save memory resource at boot time.

//
// PCD database layout:
// +---------------------------------+
// | PCD_DATABASE_INIT (DEFAULT SKU) |
// +---------------------------------+
// | PCD_DATABASE_SKU_DELTA (SKU A)  |
// +---------------------------------+
// | PCD_DATABASE_SKU_DELTA (SKU B)  |
// +---------------------------------+
// | ......                          |
// +---------------------------------+
//

BaseTools, PCD database and driver updates are needed for this proposal.
For single SKU (default) case, this proposal is expected to have no impact.
For multi-SKU case, PCD database format will be changed.
So, PcdDataBase Version is also updated from 6 to 7.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25 11:05:57 +08:00
Liming Gao 219247e164 MdeModulePkg PCD: Enable Firmware to retrieve the default setting
https://bugzilla.tianocore.org/show_bug.cgi?id=611
Update PCD driver to retrieve the default setting and set the initial
EFI variable when PcdSetNvStoreDefaultId is set.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25 11:05:57 +08:00
Liming Gao 8ddbd22716 MdeModulePkg HiiDataBase: Enable Firmware to retrieve the default setting
https://bugzilla.tianocore.org/show_bug.cgi?id=611
Update HiiDataBase to retrieve the default setting and patch IFR data

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25 11:05:56 +08:00
Liming Gao fef4cfa7ca MdeModulePkg: Enable Firmware to retrieve the default setting
https://bugzilla.tianocore.org/show_bug.cgi?id=611
Add two PCDs and new PCD DB format definition

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25 11:05:55 +08:00
Liming Gao a37044efba MdeModulePkg VariableDxe: Update it supports normal format variable storage
PEI may report the normal format variable storage HOB for the default
EFI variable. VariableDxe needs to support it and set them into NV variable
region.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25 11:05:55 +08:00
Liming Gao c05c2c0526 BaseTools: Fixed the issue of structure pcd filed sku inherit override
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:54 +08:00
Liming Gao 8ac167890f BaseTools: Fix VPD data optimization issue
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:54 +08:00
Liming Gao a09395932d BaseTools: Support nest field name in DSC/DEC
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:53 +08:00
BobCF 520365decb BaseTools: Check PCD DataType and the maxsize.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:53 +08:00
Liming Gao 67e63e9a7b BaseTools: Correct PCD generation logic to make sure DB is use
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:52 +08:00
Liming Gao 0b6c5954e1 BaseTools: Generate correct VPD PCD value to store the default setting
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:51 +08:00
Liming Gao b23957242c BaseTools: Add error message if Structure PCD value is wrong
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25 11:05:51 +08:00
Liming Gao 65eff519e5 BaseTools: Fixed the issue of Multiple Skus are always disables
When multiple skus are enabled, PCD database should record the supported SKUs.
This patch fixes PCD database to add the missing supported SKUs.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@Intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:50 +08:00
Liming Gao 626bece451 BaseTools: Optimize VPD PCD value for the different SKUs
If VPD PCD value is same in the different SKUs, the different SKUs will
save the same offset for this PCD in VPD region. That means there is only
one PCD value copy in VPD region to save VPD space.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:50 +08:00
Liming Gao 7e6e459a3d BaseTools: Update SkuId as SKU_ID type to follow current implementation
Update PCD DB and Default setting format as nature alignment.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25 11:05:49 +08:00
Liming Gao 47854fd598 BaseTools: Update NV Default Header format to include the max size
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@Intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:48 +08:00
Liming Gao e651d06c5e BaseTools: Report Structure PCD value and SKU, DefaultStore info
https://bugzilla.tianocore.org/show_bug.cgi?id=706
Add Structure PCD support for Build report. Structure PCD field value described
in DEC/DSC will be display in build report. And, PCD value for each SKU and
Default store will also be shown in build report.

Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:48 +08:00
Liming Gao 2b8a6c44e0 BaseTools: PcdDataBase Optimization for multiple SkuIds
https://bugzilla.tianocore.org/show_bug.cgi?id=546
BaseTools will generate the optimized PCD database to save the image size
at build time for multiple SKUs. The optimized PCD database layout will be like
below, the PCD database will be composed of the full default SKU data
(PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA).
PCD driver will build HOB to store the full default SKU data, and patch HOB
data based on non-default SKU delta data for the SKU set by SetSku(),
it can save memory resource at boot time.

//
// PCD database layout:
// +---------------------------------+
// | PCD_DATABASE_INIT (DEFAULT SKU) |
// +---------------------------------+
// | PCD_DATABASE_SKU_DELTA (SKU A)  |
// +---------------------------------+
// | PCD_DATABASE_SKU_DELTA (SKU B)  |
// +---------------------------------+
// | ......                          |
// +---------------------------------+
//

BaseTools, PCD database and driver updates are needed for this proposal.
For single SKU (default) case, this proposal is expected to have no impact.
For multi-SKU case, PCD database format will be changed.
So, PcdDataBase Version is also updated from 6 to 7.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:47 +08:00
Liming Gao 8518bf0b92 BaseTools: Support Structure PCD value inherit between the different SKUs
https://bugzilla.tianocore.org/show_bug.cgi?id=543
Structure PCD field value can inherit between the different SKUIds.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:47 +08:00
Liming Gao 34952f493c BaseTools: Collect DynamicHii PCD values and assign it to VPD PCD Value
https://bugzilla.tianocore.org/show_bug.cgi?id=661
Collect all DynamicHii and DynamicExHii PCD value into PCD
PcdNvStoreDefaultValueBuffer, then firmware can access this PCD value
to get the variable default setting.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 11:05:46 +08:00
Liming Gao ae7b6df816 BaseTools: Support Structure PCD value assignment in DEC/DSC
https://bugzilla.tianocore.org/show_bug.cgi?id=542
This is pure BaseTools enhancement to support PCD with one structure.
User can specify PCD value based on its structure field.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25 11:05:45 +08:00
Liming Gao 309e37a229 BaseTools: Add PcdValueCommon logic into C source CommonLib
PcdValueCommon is used to calculate structure pcd value.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25 11:05:45 +08:00
Liming Gao 84e076c861 BaseTools: Update Makefile to work at absolute path
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25 11:05:44 +08:00
Hao Wu c40dbe5e7b BaseTools/GenSec: Fix potential null pointer dereference
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:56 +08:00
Hao Wu ae0fbb7f5a BaseTools/GenSec: Fix potential memory leak
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:48 +08:00
Hao Wu 33fc1fc46d BaseTools/GenFfs: Enlarge the size of 'AlignmentBuffer'
As a workaround for the static code checkers, enlarge the size of the
string buffer 'AlignmentBuffer' so that it can hold all the digits of an
unsigned 32-bit integer plus the size unit character (e.g. 'M' & 'K').

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:44 +08:00
Hao Wu b748e35c2b BaseTools/VfrCompile: Resolve uninit class variables in constructor
The commit initializes those possibly uninitialized class variables in
class constructors.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:41 +08:00
Hao Wu d837f33ab0 BaseTools/VfrCompile: Add/refine boundary checks for strcpy/strcat
Add checks to ensure when the destination string buffer is of fixed
size, the strcpy/strcat functions calls will not access beyond the
boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:37 +08:00
Hao Wu 1c47ab0404 BaseTools/GenVtf: Add/refine boundary checks for strcpy/strcat calls
Add checks to ensure when the destination string buffer is of fixed
size, the strcpy/strcat functions calls will not access beyond the
boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:34 +08:00
Hao Wu fc42d0e890 BaseTools/GenFv: Add/refine boundary checks for strcpy/strcat calls
Add checks to ensure when the destination string buffer is of fixed
size, the strcpy/strcat functions calls will not access beyond the
boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:30 +08:00
Hao Wu 1bdd9465c1 BaseTools/GenBootSector: Add/refine boundary checks for strcpy/strcat
Add checks to ensure when the destination string buffer is of fixed
size, the strcpy/strcat functions calls will not access beyond the
boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:25 +08:00
Hao Wu 52e8c56838 BaseTools/EfiRom: Add/refine boundary checks for strcpy/strcat calls
Add checks to ensure when the destination string buffer is of fixed
size, the strcpy/strcat functions calls will not access beyond the
boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:22 +08:00
Hao Wu 3e1497334e BaseTools/C/Common: Refine using sprintf() with '%s' in format string
The commit removes the usages of sprintf() function calls with '%s' in
the format string. And uses strncpy/strncat instead to ensure the
destination string buffers will not be accessed beyond their boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:18 +08:00
Hao Wu 938cf4b9bd BaseTools/C/Common: Add/refine boundary checks for strcpy/strcat calls
Add checks to ensure when the destination string buffer is of fixed
size, the strcpy/strcat functions calls will not access beyond the
boundary.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25 09:54:10 +08:00