Re: [PATCH 2/7] Add rpm extraction routines (use librpm and libarchive)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- "Chris Lumens" <clumens@xxxxxxxxxx> wrote:

> > +        /* Strip leading slashes */
> > +        while (filename[offset] == '/')
> > +            offset+=1;
> > +
> > +        /* Strip leading ./ */
> > +        while (filename[offset] == '.' && filename[offset+1] ==
> '/')
> > +            offset+=2;
> 
> I think you're still going to have the problem with "/", ".", "./"
> that
> pjones mentioned in
> https://www.redhat.com/archives/anaconda-devel-list/2009-December/msg00416.html
> here.

No I won't... the memory looks like this:

['.', '\0'] or ['.', '/', '\0'] or ['/', '\0']

So it will end up as empty string, but it definitely won't segfault, because '\0' won't match neither '/' nor '.'.

> > +            if (fdout==NULL){
> > +                free((void*)filename);
> > +                rc = 33;
> > +                break;
> > +            }
> 
> I don't think you need to cast this.

My GCC thinks I do for some reason. It didn't build without this... I tried. (it was just a warning, but we are converting them to errors)

Martin

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux