grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls and grub_vsprintf bug fixes.


From: Hollis Blanchard
Subject: Re: ls and grub_vsprintf bug fixes.
Date: Sat, 22 Oct 2005 21:57:34 -0500

On Oct 21, 2005, at 5:20 PM, Timothy Baldwin wrote:

Normal mode ls leaks disk handles because it doesn't close files properly.
grub_vsprintf doesn't terminate a string it passes to grub_strtoul.

Have these fixes been applied? Savannah seems to be down, so I can't tell. :(

I am happy with both of these.

-Hollis

2005-10-21  Timothy Baldwin  <address@hidden>

        * commands/ls.c (grub_ls_list_files) <long format>:
        Close file with grub_file_close.

        * kern/misc.c (grub_vsprintf) <Read formatting parameters>:
        Terminate S.


diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x
'*.orig' -x CVS grub2-submitted/commands/ls.c grub2-arm/commands/ls.c
--- grub2-submitted/commands/ls.c       2005-08-20 08:27:40.000000000 +0100
+++ grub2-arm/commands/ls.c     2005-10-21 22:14:35.000000000 +0100
@@ -130,7 +130,7 @@ grub_ls_list_files (char *dirname, int l
                grub_printf ("%-12d", file->size);
        
            }
-         (fs->close) (file);
+         grub_file_close (file);
        }
       else
        grub_printf ("%-12s", "DIR");
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x
'*.orig' -x CVS grub2-submitted/kern/misc.c grub2-arm/kern/misc.c
--- grub2-submitted/kern/misc.c 2005-08-21 07:46:28.000000000 +0100
+++ grub2-arm/kern/misc.c       2005-10-21 19:21:46.000000000 +0100
@@ -577,8 +577,9 @@ grub_vsprintf (char *str, const char *fm

          if (p > fmt)
            {
-             char s[p - fmt];
+             char s[p - fmt + 1];
              grub_strncpy (s, fmt, p - fmt);
+             s[p - fmt] = 0;
              if (s[0] == '0')
                zerofill = '0';
              format1 = grub_strtoul (s, 0, 10);


--
Member AFFS, WYLUG, SWP (UK), UAF, RESPECT, StWC
No to software patents!    Victory to the iraqi resistance!
_______________________________________________
Grub-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/grub-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]