From 1dea9f1268eb606b5c220948685ba03f3ec4b246 Mon Sep 17 00:00:00 2001 From: Shreenidhi Shedi Date: Fri, 10 Jun 2022 15:39:50 +0530 Subject: [PATCH] boot: use efi_memcpy inplace of memcpy `efi_memcpy` does some validations before referencing pointers, it is the safer option for this case. Fixes: CID#1489876 --- src/boot/efi/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index e191fe58664..b75589f53dc 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -67,7 +67,7 @@ static inline void *xmalloc_multiply(size_t size, size_t n) { _malloc_ _alloc_(3) _returns_nonnull_ _warn_unused_result_ static inline void *xrealloc(void *p, size_t old_size, size_t new_size) { void *r = xmalloc(new_size); - memcpy(r, p, MIN(old_size, new_size)); + efi_memcpy(r, p, MIN(old_size, new_size)); free(p); return r; } -- 2.47.3