Author: tsoome
Date: Thu Feb 20 08:53:04 2020
New Revision: 358158
URL: https://svnweb.freebsd.org/changeset/base/358158

Log:
  efihttp_fs_seek() is missing NULL pointer check
  
  Add missing check of malloc() result.

Modified:
  head/stand/efi/libefi/efihttp.c

Modified: head/stand/efi/libefi/efihttp.c
==============================================================================
--- head/stand/efi/libefi/efihttp.c     Thu Feb 20 08:48:34 2020        
(r358157)
+++ head/stand/efi/libefi/efihttp.c     Thu Feb 20 08:53:04 2020        
(r358158)
@@ -701,6 +701,8 @@ efihttp_fs_seek(struct open_file *f, off_t offset, int
                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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to