mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-14 07:12:08 +00:00
strndupa: allocate len + 1, so that \0 is not lost
Signed-off-by: Alex Burmashev <alexander.burmashev@oracle.com>
This commit is contained in:
parent
07724ab645
commit
0287b5a864
@ -55,7 +55,7 @@ strndupa(const CHAR8 * const src, const UINTN srcmax)
|
||||
return news;
|
||||
|
||||
len = strnlena(src, srcmax);
|
||||
news = AllocateZeroPool(len);
|
||||
news = AllocateZeroPool(len + 1);
|
||||
if (news)
|
||||
strncpya(news, src, len);
|
||||
return news;
|
||||
|
Loading…
Reference in New Issue
Block a user