[23664] in bugtraq

home help back first fref pref prev next nref lref last post

Re: gzip bug w/ patch..

daemon@ATHENA.MIT.EDU (Tim J. Robbins)
Mon Dec 31 18:30:22 2001

Date: Mon, 31 Dec 2001 13:05:38 +1100
From: "Tim J. Robbins" <tim@robbins.dropbear.id.au>
To: bugtraq@securityfocus.com
Message-ID: <20011231130538.B9804@raven.robbins.dropbear.id.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <001901c1913d$edb9e4a0$3fdaf30c@c534987-a.attbi.com>; from gregn@dekode.org on Sun, Dec 30, 2001 at 02:26:10PM -0000

On Sun, Dec 30, 2001 at 02:26:10PM -0000, greg wrote:

> well anyway, there is an attached patch, bye.

> -           strcpy(nbuf,dir);
> +           strncpy(nbuf, dir, sizeof(nbuf) - 1);

You must ensure the trailing NUL character is at the end of the
string:
  nbuf[sizeof(nbuf) - 1] = '\0';


Tim

home help back first fref pref prev next nref lref last post