]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/ufs: Add missing error check.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:36:19 +0000 (09:36 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:36:19 +0000 (09:36 +0100)
Found by: Coverity scan.

grub-core/fs/ufs.c

index f560ad3806801c750d61b0e617947f29dccc69c7..0619d6e324d682596a9ab8476513c91d93cde216 100644 (file)
@@ -465,7 +465,13 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
       && INODE_SIZE (data) <= sizeof (data->inode.symlink))
     grub_strcpy (symlink, (char *) data->inode.symlink);
   else
-    grub_ufs_read_file (data, 0, 0, 0, sz, symlink);
+    {
+      if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
+       {
+         grub_free(symlink);
+         return grub_errno;
+       }
+    }
   symlink[sz] = '\0';
 
   /* The symlink is an absolute path, go back to the root inode.  */