All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] strncpy misuse in ufs.c]
@ 2006-04-11 12:08 Lubomir Kundrak
  2006-04-12  6:06 ` Lubomir Kundrak
  0 siblings, 1 reply; 3+ messages in thread
From: Lubomir Kundrak @ 2006-04-11 12:08 UTC (permalink / raw)
  To: grub-devel

Now again, to correct list.
Below is the little fix for fs/ufs.c

--- ufs.c.orig  2006-04-10 12:17:10.000000000 +0200
+++ ufs.c       2006-04-10 12:17:32.000000000 +0200
@@ -400,7 +400,7 @@
   unsigned int pos = 0;
   int dirino;

-  grub_strncpy (fpath, path, grub_strlen (path));
+  grub_strncpy (fpath, path, grub_strlen (path)+1);

   /* Skip the first slash.  */
   if (name[0] == '/')

regards,
lubo

-- 
  o	Lubomir Kundrak
 *O*	<lkundrak@skosi.org>, http://skosi.org/~lkundrak/
 (_)	SKOSI -- Slovak OpenSource Initiative




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] strncpy misuse in ufs.c]
  2006-04-11 12:08 [patch] strncpy misuse in ufs.c] Lubomir Kundrak
@ 2006-04-12  6:06 ` Lubomir Kundrak
  2006-04-12  8:29   ` Marco Gerards
  0 siblings, 1 reply; 3+ messages in thread
From: Lubomir Kundrak @ 2006-04-12  6:06 UTC (permalink / raw)
  To: grub-devel

EEh.... should actually read

--- ufs.c.orig  2006-04-10 12:17:10.000000000 +0200
+++ ufs.c       2006-04-10 12:17:32.000000000 +0200
@@ -400,7 +400,7 @@
   unsigned int pos = 0;
   int dirino;

-  grub_strncpy (fpath, path, grub_strlen (path));
+  grub_strncpy (fpath, path, sizeof (fpath)+);

   /* Skip the first slash.  */
   if (name[0] == '/')


On Tue, Apr 11, 2006 at 02:08:22PM +0200, Lubomir Kundrak wrote:
> X-Original-To: lkundrak@skosi.org
> Delivered-To: lkundrak@morph.sk
> Date: Tue, 11 Apr 2006 14:08:22 +0200
> From: Lubomir Kundrak <lkundrak@skosi.org>
> To: grub-devel@gnu.org
> Mail-Followup-To: Lubomir Kundrak <lkundrak@skosi.org>, grub-devel@gnu.org
> User-Agent: Mutt/1.4.2.1i
> Subject: [patch] strncpy misuse in ufs.c]
> X-BeenThere: grub-devel@gnu.org
> X-Mailman-Version: 2.1.5
> Precedence: list
> Reply-To: The development of GRUB 2 <grub-devel@gnu.org>
> List-Id: The development of GRUB 2 <grub-devel.gnu.org>
> List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/grub-devel>,
> 	<mailto:grub-devel-request@gnu.org?subject=unsubscribe>
> List-Archive: <http://lists.gnu.org/pipermail/grub-devel>
> List-Post: <mailto:grub-devel@gnu.org>
> List-Help: <mailto:grub-devel-request@gnu.org?subject=help>
> List-Subscribe: <http://lists.gnu.org/mailman/listinfo/grub-devel>,
> 	<mailto:grub-devel-request@gnu.org?subject=subscribe>
> Errors-To: grub-devel-bounces+lkundrak=skosi.org@gnu.org
> 
> Now again, to correct list.
> Below is the little fix for fs/ufs.c
> 
> --- ufs.c.orig  2006-04-10 12:17:10.000000000 +0200
> +++ ufs.c       2006-04-10 12:17:32.000000000 +0200
> @@ -400,7 +400,7 @@
>    unsigned int pos = 0;
>    int dirino;
> 
> -  grub_strncpy (fpath, path, grub_strlen (path));
> +  grub_strncpy (fpath, path, grub_strlen (path)+1);
> 
>    /* Skip the first slash.  */
>    if (name[0] == '/')
> 
> regards,
> lubo
> 
> -- 
>   o	Lubomir Kundrak
>  *O*	<lkundrak@skosi.org>, http://skosi.org/~lkundrak/
>  (_)	SKOSI -- Slovak OpenSource Initiative
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel

-- 
  o	Lubomir Kundrak
 *O*	<lkundrak@skosi.org>, http://skosi.org/~lkundrak/
 (_)	SKOSI -- Slovak OpenSource Initiative



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] strncpy misuse in ufs.c]
  2006-04-12  6:06 ` Lubomir Kundrak
@ 2006-04-12  8:29   ` Marco Gerards
  0 siblings, 0 replies; 3+ messages in thread
From: Marco Gerards @ 2006-04-12  8:29 UTC (permalink / raw)
  To: Lubomir Kundrak; +Cc: grub-devel

Lubomir Kundrak <lkundrak@skosi.org> writes:

> EEh.... should actually read
>
> --- ufs.c.orig  2006-04-10 12:17:10.000000000 +0200
> +++ ufs.c       2006-04-10 12:17:32.000000000 +0200
> @@ -400,7 +400,7 @@
>    unsigned int pos = 0;
>    int dirino;
>
> -  grub_strncpy (fpath, path, grub_strlen (path));
> +  grub_strncpy (fpath, path, sizeof (fpath)+);

Why the floating plus?  Isn't this wrong?

Can you please explain what the patch exactly fixes and why the
current code is wrong?  Also, please submit a changelog entry.

--
Marco




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-12  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-11 12:08 [patch] strncpy misuse in ufs.c] Lubomir Kundrak
2006-04-12  6:06 ` Lubomir Kundrak
2006-04-12  8:29   ` Marco Gerards

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.