*BSD News Article 42902


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!ihnp4.ucsd.edu!swrinde!cs.utexas.edu!not-for-mail
From: wcp@lpds.sublink.org (Walter C. Pelissero)
Newsgroups: comp.os.386bsd.bugs
Subject: GNU tar on FreeBSD 2.0
Followup-To: comp.os.386bsd.bugs
Date: 25 Feb 1995 17:40:46 -0600
Organization: Sweet home under white clouds
Lines: 34
Sender: nobody@cs.utexas.edu
Message-ID: <WCP.95Feb25175036@lpds.lpds.com>
NNTP-Posting-Host: news.cs.utexas.edu

It seems that I found a bug in GNU tar as distributed in FreeBSD 2.0.

In create.c a msg_perror() call is made with a long long argument that
makes stdarg routines (actually vfprintf()) dump a core. A proper cast
to long fix the problem.

This is the little patch:

*** /radikkio:/usr/src/gnu/usr.bin/tar/create.c.orig
--- /radikkio:/usr/src/gnu/usr.bin/tar/create.c
***************
*** 574,580 ****
  	    if (count < 0)
  	      {
  		msg_perror ("read error at byte %ld, reading\
!  %d bytes, in file %s", hstat.st_size - sizeleft, bufsize, p);
  		goto padit;
  	      }
  	    sizeleft -= count;
--- 574,580 ----
  	    if (count < 0)
  	      {
  		msg_perror ("read error at byte %ld, reading\
!  %d bytes, in file %s", (long) hstat.st_size - sizeleft, bufsize, p);
  		goto padit;
  	      }
  	    sizeleft -= count;

I didn't cross post this article on a gnu newsgroup since I belive
this is a FreeBSD specific problem.  Here the st_size element of the
hstat struct is a off_t type which is a quad_t type which is a long
long.
--
P4 32 8 @A ^@@A ^@@Ax^@@A ^@DA"^@D]%xJe&H1\236\331\306