[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cfengine 1.6.3 src/image.c: uninitialised variable lastnode
From: |
Mark . Burgess |
Subject: |
Re: cfengine 1.6.3 src/image.c: uninitialised variable lastnode |
Date: |
Tue, 12 Feb 2002 20:50:10 +0100 (MET) |
I believe the Debian maintainer is patching 1.6.3 -- I don't have the
resources to maintain 2 versions. I think you'll find version 2 (beta
in about a week, just to be sure) has many improvements, and bug fixes.
I recommend upgrading,
Mark
On 12 Feb, Sergio Gelato wrote:
> This bug was already reported on 1999-08-18 by Roar Thronæs, but is still
> unfixed in 1.6.3. Is anyone collecting and distributing maintenance fixes
> for cfengine 1?
>
> In function ImageCopy() (src/image.c) the local variable lastnode is never
> initialised. When it is passed as an input argument to IsWildItemIn(), an
> access violation results.
>
> I'm tentatively adding
>
> if (lastnode = strrchr(sourcefile,'/'))
> lastnode++;
> else
> lastnode = sourcefile;
>
> just before the calls to IsWildItemIn(), but would like an opinion as
> to whether this is the correct fix.
>
> I'm not too impressed with the coding style in src/link.c:
>
> for (lastnode = from+strlen(from); *lastnode != '/'; lastnode--)
> {
> }
>
> lastnode++;
>
> not least because there is no immediately obvious guarantee that the
> string does in fact contain a '/'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: address@hidden
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~