tar segfaults (busybox 1.8.1)

Tito farmatito at tiscali.it
Fri Nov 16 23:34:27 UTC 2007


On Friday 16 November 2007 21:34:25 Denys Vlasenko wrote:
> On Friday 16 November 2007 12:24, Alexander Griesser wrote:
> > Tito schrieb:
> > > by compiling the latest svn i get this warning:
> > >
> > > CC      archival/tar.o
> > > archival/tar.c: In function ‘writeFileToTarball’:
> > > archival/tar.c:183: warning: call to __builtin___strcpy_chk will always
> > > overflow destination buffer
> >
> > You're right, I somehow didn't recognize that.
> >
> > > and after changing the line 183 of tar.c
> > >
> > > -	strcpy(hp->magic, "ustar  ");
> > > +	strcpy(hp->magic, "ustar");
> > >
> > > there is no segfault due to the fact
> > > that the size of hp->magic is
> > >
> > > 	char magic[6];            /* 257-262 */
> >
> > Works for me too.
> 
> The problem is, now your tar file is a bit different and may fail to untar.
> 
> I updated tar fix:
> 
> http://busybox.net/downloads/fixes-1.8.1/busybox-1.8.1-tar_z.patch
> 
> please try that
> --
> vda
> 
Hi, works fine here.

root at localhost:~/Desktop/busybox# touch a s d
root at localhost:~/Desktop/busybox# ./busybox tar cf test.tar a s d
root at localhost:~/Desktop/busybox# ls -la test.tar
-rw-r--r-- 1 root root 2560 2007-11-17 00:32 test.tar
root at localhost:~/Desktop/busybox# ./busybox tar xvf test.tar
a
s
d
root at localhost:~/Desktop/busybox# tar xvf test.tar
a
s
d
root at localhost:~/Desktop/busybox#                               


Ciao,
Tito



More information about the busybox mailing list