]> git.proxmox.com Git - grub2.git/commitdiff
disk/geli: Add missing seek success check.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:46:23 +0000 (21:46 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:46:23 +0000 (21:46 +0100)
Found by: Coverity scan.

grub-core/disk/geli.c

index 4ed07bb913dc055694569232c4814b8456b125cd..bf73fbde882448d2bbd1b867bb237e8f3f84950a 100644 (file)
@@ -212,7 +212,8 @@ grub_util_get_geli_uuid (const char *dev)
 
   s = grub_util_get_fd_size (fd, dev, &log_secsize);
   s >>= log_secsize;
-  grub_util_fd_seek (fd, (s << log_secsize) - 512);
+  if (grub_util_fd_seek (fd, (s << log_secsize) - 512) < 0)
+    grub_util_error ("%s", _("couldn't read ELI metadata"));
 
   uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1);
   if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0)