[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug fixed on grub_strncat()
From: |
Robert Millan |
Subject: |
Re: bug fixed on grub_strncat() |
Date: |
Sun, 13 Apr 2008 16:58:30 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Both fixed, thank you!
On Thu, Mar 20, 2008 at 10:52:45AM +0800, zhanghuan wrote:
> grub_strncat() eats the last char copid from 'dest', this patch should fix it.
>
> diff -ur grub-1.96/kern/misc.c grub-1.96fix/kern/misc.c
> --- grub-1.96/kern/misc.c 2008-02-03 21:11:31.000000000 +0800
> +++ grub-1.96fix/kern/misc.c 2008-03-20 10:39:36.000000000 +0800
> @@ -110,7 +110,8 @@
>
> while ((*p++ = *src++) != '\0' && --c)
> ;
> - *(--p) = '\0';
> + if (!c)
> + *(p) = '\0';
>
>
>
> PS: no body cares about previous patch I sent??
> I put it below, it is easy to understand when you read it.
>
> diff -ur grub-1.96/kern/env.c grub-1.96fix/kern/env.c
> --- grub-1.96/kern/env.c 2008-01-06 15:15:07.000000000 +0800
> +++ grub-1.96fix/kern/env.c 2008-03-12 10:02:07.000000000 +0800
> @@ -124,7 +124,7 @@
> {
> struct grub_env_var *p, *q;
>
> - for (p = current_context->prev->vars[i]; p; p = q)
> + for (p = current_context->vars[i]; p; p = q)
> {
> q = p->next;
> grub_free (p);
>
>
> Zhang Huan
> Tel: (86)10-6260-0549
> Mailing: P. O. Box 2704# Beijing
> Postcode: 100080
> National Research Centre for High Performance Computers
> Institute of Computing Technology, Chinese Academy of Sciences
> No. 6, South Kexueyuan Road, Haidian District
> Beijing, China
>
>
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: bug fixed on grub_strncat(),
Robert Millan <=