Reporting Issues
Bug 2721 - Both ResultReportLibs use wrong bounded StrCpy function.
Summary: Both ResultReportLibs use wrong bounded StrCpy function.
Status: RESOLVED FIXED
Alias: None
Product: EDK2
Classification: Unclassified
Component: Code (show other bugs)
Version: Current
Hardware: All All
: Normal normal
Assignee: Michael Kubacki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-14 17:18 UTC by Bret Barkelew
Modified: 2020-05-27 01:30 UTC (History)
2 users (show)

See Also:
EDK II Code First industry standard specifications: ---
Branch URL:
Release(s) the issue is observed:
The OS the target platform is running: ---
Package: UnitTestFrameworkPkg
Release(s) the issues must be fixed:
Tianocore documents:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bret Barkelew 2020-05-14 17:18:33 UTC
Currently both ReportOutput() implementations use AsciiStrCpyS() to copy from the log string to the intermediate output buffer. However, while this function is Safe, it ASSERTs when there's an error, which actually is not what is desired from the way the loop is wrapped.

Needs to change to AsciiStrnCpyS().

Will post a patch to Mu Basecore.
Comment 1 Bret Barkelew 2020-05-19 16:21:25 UTC
Easy (2-line) patch is available in this commit:
https://github.com/microsoft/mu_basecore/commit/c2e5d8a57219cf5af2fda148452ab061d6fb9670
Comment 2 nobody 2020-05-19 21:38:48 UTC
Michael: please send this patch before Friday.
Comment 3 Michael Kubacki 2020-05-20 21:29:56 UTC
V1 patch on edk2 mailing list: https://edk2.groups.io/g/devel/message/60007
Comment 4 nobody 2020-05-27 01:30:25 UTC
Merge at https://github.com/tianocore/edk2/pull/644