]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: use efi_memcpy inplace of memcpy
authorShreenidhi Shedi <sshedi@vmware.com>
Fri, 10 Jun 2022 10:09:50 +0000 (15:39 +0530)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jun 2022 19:25:35 +0000 (04:25 +0900)
`efi_memcpy` does some validations before referencing pointers, it is
the safer option for this case.

Fixes: CID#1489876
src/boot/efi/util.h

index e191fe58664ebd7a695bd57640f8ace958aa1e2f..b75589f53dc0452216fd1bc5691d4b1001af7a20 100644 (file)
@@ -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;
 }