MdePkg UefiDevicePathLib: Fix possible memory read/write cross boundary
The SSID field of a Wi-Fi device path node may not contain a NULL termination. Additonal handle is added to make sure no cross-boundary memory read/write will occur. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18355 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1616,9 +1616,14 @@ DevPathToTextWiFi (
|
||||
)
|
||||
{
|
||||
WIFI_DEVICE_PATH *WiFi;
|
||||
UINT8 SSId[33];
|
||||
|
||||
WiFi = DevPath;
|
||||
UefiDevicePathLibCatPrint (Str, L"Wi-Fi(%a)", WiFi->SSId);
|
||||
|
||||
SSId[32] = '\0';
|
||||
CopyMem (SSId, WiFi->SSId, 32);
|
||||
|
||||
UefiDevicePathLibCatPrint (Str, L"Wi-Fi(%a)", SSId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user