]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/commands/legacycfg.c (grub_cmd_legacy_kernel):
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 10 Feb 2012 13:30:19 +0000 (14:30 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 10 Feb 2012 13:30:19 +0000 (14:30 +0100)
Avoid improper use of strings.
(grub_cmd_legacy_initrdnounzip): Likewise.

ChangeLog
grub-core/commands/legacycfg.c

index feeea672c182249ba6a99101b6e1684badac3fd2..7355a45501cd60520ba4b13e7bc666390887237e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/commands/legacycfg.c (grub_cmd_legacy_kernel):
+       Avoid improper use of strings.
+       (grub_cmd_legacy_initrdnounzip): Likewise.
+
 2012-02-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/emu/misc.h (grub_util_warn): Add missing format
index f4939a99631942008e7d0174e612f56fd9f7bf31..f33abeac55051d8dee3dcf5d25575d724911213a 100644 (file)
@@ -411,10 +411,11 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)),
            }
          else
            {
+             char rbuf[3] = "-r";
              bsdargc = cutargc + 2;
              bsdargs = grub_malloc (sizeof (bsdargs[0]) * bsdargc);
              grub_memcpy (bsdargs, args, argc * sizeof (bsdargs[0]));
-             bsdargs[argc] = "-r";
+             bsdargs[argc] = rbuf;
              bsdargs[argc + 1] = bsddevname;
              grub_snprintf (bsddevname, sizeof (bsddevname),
                             "wd%d%c", bsd_device,
@@ -502,11 +503,12 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused
     {
       char **newargs;
       grub_err_t err;
+      char nounzipbuf[10] = "--nounzip";
       newargs = grub_malloc ((argc + 1) * sizeof (newargs[0]));
       if (!newargs)
        return grub_errno;
       grub_memcpy (newargs + 1, args, argc * sizeof (newargs[0]));
-      newargs[0] = "--nounzip";
+      newargs[0] = nounzipbuf;
       cmd = grub_command_find ("module");
       if (!cmd)
        return grub_error (GRUB_ERR_BAD_ARGUMENT, "command module not found");