tags 537434 fixed-upstream
thanks

On Fri, Feb 12, 2010 at 02:16:08PM +0100, Vincent Lefevre wrote:
> On 2010-02-12 13:45:55 +0100, Vincent Lefevre wrote:
> > I've done some analysis with strace. The problem is that in zsoelim.c,
> > man sometimes tries to open man1/zshxxx.1 instead of the .gz version.
> > The reason is a bug in decompress_open() from lib/decompress.c (the
> > function sometimes returns a non-null pointer value, though stat()
> > failed). The code contains:
> > 
> >         if (stat (filename, &st) < 0 && !S_ISDIR (st.st_mode))
> >                 return NULL;
> > 
> > But if stat() fails, st may not have been filled in, so that the
> > test !S_ISDIR (st.st_mode) makes no sense. Shouldn't this be:
> > 
> >         if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode))
> >                 return NULL;
> > 
> > i.e. if the file doesn't exist or is a directory, one returns a
> > null pointer?
> 
> I've attached a patch corresponding to this change. Seems to work.

Thanks!  You're quite right, of course.  Applied upstream.

Sat Feb 13 14:25:42 GMT 2010  Vincent Lefèvre  <[email protected]>

        * lib/decompress.c (decompress_open): Fix sense of directory check
          (Debian bug #537434).

-- 
Colin Watson                                       [[email protected]]



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to