Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JcAt4-0006LF-MM for mharc-grub-devel@gnu.org; Wed, 19 Mar 2008 22:52:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcAt2-0006KX-Oi for grub-devel@gnu.org; Wed, 19 Mar 2008 22:52:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcAsr-0006GS-Jr for grub-devel@gnu.org; Wed, 19 Mar 2008 22:52:11 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcAsr-0006GM-9Y for grub-devel@gnu.org; Wed, 19 Mar 2008 22:52:01 -0400 Received: from [159.226.39.252] (helo=nrchpc.ac.cn) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JcAsq-0002ya-9X for grub-devel@gnu.org; Wed, 19 Mar 2008 22:52:01 -0400 Received: from zhanghuan ([159.226.39.251]) by nrchpc.ac.cn (8.13.7/8.13.7) with ESMTP id m2K334pA005659 for ; Thu, 20 Mar 2008 11:03:04 +0800 From: "zhanghuan" To: Date: Thu, 20 Mar 2008 10:52:45 +0800 Organization: =?utf-8?B?5Zu95a626auY5oCn6IO96K6h566X5py65bel56iL5oqA5pyv56CU56m25Lit5b+D?= Message-ID: <000001c88a35$7994bdf0$5101670a@zhanghuan> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: AciKNXkBFfVzYAbDQ/27le9mugZ98A== X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: bug fixed on grub_strncat() X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2008 02:52:13 -0000 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