]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/geli.c (grub_md_sha256_real): Respect format security.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 10 Feb 2012 13:01:53 +0000 (14:01 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 10 Feb 2012 13:01:53 +0000 (14:01 +0100)
(grub_md_sha512_real): Likewise.
(grub_util_get_geli_uuid): Likewise.
* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Likewise.
(grub_util_biosdisk_open): Fix format specification.
Respect format security.
* grub-core/kern/emu/misc.c (xmalloc): Respect format security.
(xrealloc): Likewise.
(xasprintf): Likewise.

ChangeLog
grub-core/disk/geli.c
grub-core/kern/emu/hostdisk.c
grub-core/kern/emu/misc.c

index 1e710cee6cee723a4f3932f82d86b70ce772b38e..852bf6aa71d7f39063f4fd4554322b6547c09fe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-02-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/disk/geli.c (grub_md_sha256_real): Respect format security.
+       (grub_md_sha512_real): Likewise.
+       (grub_util_get_geli_uuid): Likewise.
+       * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Likewise.
+       (grub_util_biosdisk_open): Fix format specification.
+       Respect format security.
+       * grub-core/kern/emu/misc.c (xmalloc): Respect format security.
+       (xrealloc): Likewise.
+       (xasprintf): Likewise.
+
 2012-02-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/import_gcry.py: Include grub/crypto.h in init.c.
index c4d092da8b56d8d9994c05f5b489a84b53019040..855c12e4cb0f8654fa71b0595b992dfdaffee4fe 100644 (file)
@@ -72,7 +72,7 @@ grub_md_sha256_real (void)
   const gcry_md_spec_t *ret;
   ret = grub_crypto_lookup_md_by_name ("sha256");
   if (!ret)
-    grub_util_error (_("Coulnd't load sha256"));
+    grub_util_error ("%s", _("Coulnd't load sha256"));
   return ret;
 }
 
@@ -82,7 +82,7 @@ grub_md_sha512_real (void)
   const gcry_md_spec_t *ret;
   ret = grub_crypto_lookup_md_by_name ("sha512");
   if (!ret)
-    grub_util_error (_("Coulnd't load sha512"));
+    grub_util_error ("%s", _("Coulnd't load sha512"));
   return ret;
 }
 
@@ -226,7 +226,7 @@ grub_util_get_geli_uuid (const char *dev)
 
   uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1);
   if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0)
-    grub_util_error (_("couldn't read ELI metadata"));
+    grub_util_error ("%s", _("couldn't read ELI metadata"));
          
   COMPILE_TIME_ASSERT (sizeof (header) <= 512);
   header = (void *) &hdr;
@@ -235,7 +235,7 @@ grub_util_get_geli_uuid (const char *dev)
   if (grub_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC))
       || grub_le_to_cpu32 (header->version) > 5
       || grub_le_to_cpu32 (header->version) < 1)
-    grub_util_error (_("wrong ELI magic or version"));
+    grub_util_error ("%s", _("wrong ELI magic or version"));
 
   err = make_uuid ((void *) &hdr, uuid);
   if (err)
index 7d7b3d00c6e9d946b723e5c34034b7522fc4d264..46e751e331149963222bd2e2de29df12ba7068a2 100644 (file)
@@ -308,7 +308,7 @@ grub_util_get_fd_sectors (int fd, const char *name, unsigned *log_secsize)
     return minfo.dki_capacity;
 # else
     if (nr & ((1 << log_sector_size) - 1))
-      grub_util_error (_("unaligned device size"));
+      grub_util_error ("%s", _("unaligned device size"));
 
     return (nr >> log_sector_size);
 # endif
@@ -387,7 +387,8 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
 
     close (fd);
 
-    grub_util_info ("the size of %s is %llu", name, disk->total_sectors);
+    grub_util_info ("the size of %s is %" PRIuGRUB_UINT64_T,
+                   name, disk->total_sectors);
 
     return GRUB_ERR_NONE;
   }
@@ -771,7 +772,7 @@ grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add)
     return NULL;
 
   if (i == ARRAY_SIZE (map))
-    grub_util_error (_("device count exceeds limit"));
+    grub_util_error ("%s", _("device count exceeds limit"));
 
   map[i].device = xstrdup (os_disk);
   map[i].drive = xmalloc (sizeof ("hostdisk/") + strlen (os_disk));
index 21f314d55263664b23dca6606e450f652b5739c6..53753a818600e6c10ce2817a437bbd0804ee2119 100644 (file)
@@ -117,7 +117,7 @@ xmalloc (grub_size_t size)
 
   p = malloc (size);
   if (! p)
-    grub_util_error (_("out of memory"));
+    grub_util_error ("%s", _("out of memory"));
 
   return p;
 }
@@ -127,7 +127,7 @@ xrealloc (void *ptr, grub_size_t size)
 {
   ptr = realloc (ptr, size);
   if (! ptr)
-    grub_util_error (_("out of memory"));
+    grub_util_error ("%s", _("out of memory"));
 
   return ptr;
 }
@@ -185,7 +185,7 @@ xasprintf (const char *fmt, ...)
   if (vasprintf (&result, fmt, ap) < 0)
     { 
       if (errno == ENOMEM)
-        grub_util_error (_("out of memory"));
+        grub_util_error ("%s", _("out of memory"));
       return NULL;
     }