[edk2-devel] [edk2-libc Patch] StdLib/PosixLib/GetPass: Update to use safe string functions
Rebecca Cran
rebecca at nuviainc.com
Wed Aug 18 22:04:21 UTC 2021
Reviewed-by: Rebecca Cran <rebecca at nuviainc.com>
--
Rebecca Cran
On 8/17/21 9:32 AM, Michael D Kinney wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3361
>
> Cc: Rebecca Cran <rebecca at nuviainc.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
> ---
> StdLib/PosixLib/GetPass/GetPass.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/StdLib/PosixLib/GetPass/GetPass.c b/StdLib/PosixLib/GetPass/GetPass.c
> index 46511e3..8657827 100644
> --- a/StdLib/PosixLib/GetPass/GetPass.c
> +++ b/StdLib/PosixLib/GetPass/GetPass.c
> @@ -15,6 +15,7 @@
> #include <Library/MemoryAllocationLib.h>
> #include <Library/UefiLib.h>
> #include <Library/PcdLib.h>
> +#include <limits.h>
>
> static CHAR8 *ReturnStringAscii = NULL;
>
> @@ -37,7 +38,7 @@ char *getpass(const char *Prompt)
> return (NULL);
> }
>
> - UnicodeStrToAsciiStr(ReturnString, ReturnStringAscii);
> + UnicodeStrToAsciiStrS(ReturnString, ReturnStringAscii, UNICODE_STRING_MAX);
>
> FreePool(ReturnString);
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79539): https://edk2.groups.io/g/devel/message/79539
Mute This Topic: https://groups.io/mt/84950432/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list