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:
878c81f
)
efi_loadopt_args_from_file(): make sure buf is only NULL if size is.
author
Peter Jones
<pjones@redhat.com>
Mon, 1 May 2017 19:19:18 +0000
(15:19 -0400)
committer
Peter Jones
<pjones@redhat.com>
Mon, 1 May 2017 20:06:31 +0000
(16:06 -0400)
This avoids passing NULL to fread().
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
8db8074
..
5301f3d
100644
(file)
--- a/
src/loadopt.c
+++ b/
src/loadopt.c
@@
-269,7
+269,7
@@
efi_loadopt_args_from_file(uint8_t *buf, ssize_t size, char *filename)
int saved_errno;
FILE *f;
- if (!buf && size
>
0) {
+ if (!buf && size
!=
0) {
errno = -EINVAL;
return -1;
}