efihttp_fs_seek() is missing NULL pointer check
Add missing check of malloc() result.
This commit is contained in:
parent
860545e20b
commit
8abc11f65c
@ -701,6 +701,8 @@ efihttp_fs_seek(struct open_file *f, off_t offset, int where)
|
||||
return (0);
|
||||
if (where == SEEK_SET && fh->offset < offset) {
|
||||
buf = malloc(1500);
|
||||
if (buf == NULL)
|
||||
return (ENOMEM);
|
||||
res = offset - fh->offset;
|
||||
while (res > 0) {
|
||||
err = _efihttp_fs_read(f, buf, min(1500, res), &res2);
|
||||
|
Loading…
Reference in New Issue
Block a user