mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 09:54:35 +00:00
autoboot: Add check for result of malloc_cache_aligned()
Return value of a function 'malloc_cache_aligned' is dereferenced at autoboot.c:207 without checking for NULL, but it is usually checked for this function. Found by RASU JSC. Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
This commit is contained in:
parent
91febe80c9
commit
606867c849
1 changed files with 3 additions and 0 deletions
|
@ -167,6 +167,9 @@ static int passwd_abort_sha256(uint64_t etime)
|
|||
sha_env_str = AUTOBOOT_STOP_STR_SHA256;
|
||||
|
||||
presskey = malloc_cache_aligned(DELAY_STOP_STR_MAX_LENGTH);
|
||||
if (!presskey)
|
||||
return -ENOMEM;
|
||||
|
||||
c = strstr(sha_env_str, ":");
|
||||
if (c && (c - sha_env_str < DELAY_STOP_STR_MAX_LENGTH)) {
|
||||
/* preload presskey with salt */
|
||||
|
|
Loading…
Add table
Reference in a new issue