summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Burmashev <alexander.burmashev@oracle.com>2021-02-16 06:58:05 -0500
committerPeter Jones <pjones@redhat.com>2021-02-17 19:30:19 -0500
commit0287b5a864ba6a567e6fef1b99cf001481fd59e2 (patch)
treeb545d9892b39d52fd80f7a18bd80ff2f48adec30
parent07724ab645593b5aa6d9ba0cf35aad4af29080ab (diff)
downloadefi-boot-shim-0287b5a864ba6a567e6fef1b99cf001481fd59e2.tar.gz
efi-boot-shim-0287b5a864ba6a567e6fef1b99cf001481fd59e2.zip
strndupa: allocate len + 1, so that \0 is not lost
Signed-off-by: Alex Burmashev <alexander.burmashev@oracle.com>
-rw-r--r--include/str.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/str.h b/include/str.h
index 14089c76..a6fbfefd 100644
--- a/include/str.h
+++ b/include/str.h
@@ -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;