diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2020-05-08 14:51:21 +0900 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-05-09 09:30:27 +0200 |
commit | b433acbb819e1546ef9493dc3ba97a44b398a9db (patch) | |
tree | 32682b5cd5200f7cec425475aa597a4c95956990 /lib | |
parent | 52d7bfe78787c93b95e805b44bb4d746a65edde4 (diff) | |
download | u-boot-b433acbb819e1546ef9493dc3ba97a44b398a9db.tar.gz |
efi_loader: variable: check a return value of uuid__str_to_bin()
The only error case is that a given UUID is in wrong format.
So just return EFI_INVALID_PARAMETER here.
Reported-by: Coverity (CID 300333)
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_variable.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index 60c1201757..10892684d1 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -767,7 +767,10 @@ static efi_status_t parse_uboot_variable(char *variable, /* guid */ c = *(name - 1); *(name - 1) = '\0'; /* guid need be null-terminated here */ - uuid_str_to_bin(guid, (unsigned char *)vendor, UUID_STR_FORMAT_GUID); + if (uuid_str_to_bin(guid, (unsigned char *)vendor, + UUID_STR_FORMAT_GUID)) + /* The only error would be EINVAL. */ + return EFI_INVALID_PARAMETER; *(name - 1) = c; /* attributes */ |