mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-04 09:09:56 +00:00
efihttp_fs_seek() is missing NULL pointer check
Add missing check of malloc() result.
This commit is contained in:
parent
860545e20b
commit
8abc11f65c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358158
@ -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