OSDN Git Service
(root)
/
android-x86
/
external-efivar.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6dc880
)
efi_loadopt_create(): check buf for NULLness.
author
Peter Jones
<pjones@redhat.com>
Mon, 1 May 2017 19:04:24 +0000
(15:04 -0400)
committer
Peter Jones
<pjones@redhat.com>
Mon, 1 May 2017 20:06:30 +0000
(16:06 -0400)
Found by covscan.
Signed-off-by: Peter Jones <pjones@redhat.com>
src/loadopt.c
patch
|
blob
|
history
diff --git
a/src/loadopt.c
b/src/loadopt.c
index
d4c2d46
..
8db8074
100644
(file)
--- a/
src/loadopt.c
+++ b/
src/loadopt.c
@@
-46,13
+46,20
@@
efi_loadopt_create(uint8_t *buf, ssize_t size, uint32_t attributes,
ssize_t sz = sizeof (attributes)
+ sizeof (uint16_t) + desc_len
+ dp_size + optional_data_size;
+
if (size == 0)
return sz;
+
if (size < sz) {
errno = ENOSPC;
return -1;
}
+ if (!buf) {
+ errno = EINVAL;
+ return -1;
+ }
+
if (!optional_data && optional_data_size != 0) {
errno = EINVAL;
return -1;