From p.dalgaard at biostat.ku.dk  Sat Nov  4 02:08:32 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 04 Nov 2006 02:08:32 +0100
Subject: [Rd] eval(match.call()) (PR#9339)
In-Reply-To: <Pine.GSO.4.56.0611031407480.19454@durian.statsci.com>
References: <20061103220157.64BCA19B3E@slim.kubism.ku.dk>
	<Pine.GSO.4.56.0611031407480.19454@durian.statsci.com>
Message-ID: <x2odrokohb.fsf@turmalin.kubism.ku.dk>

Bill Dunlap <bill at insightful.com> writes:

> On Fri, 3 Nov 2006 marc_schwartz at comcast.net wrote:
> 
> > > > On Fri, 2006-11-03 at 21:15 +0100, Peter Dalgaard wrote:
> > > > > > x <- quote(match.call())
> > > > > > eval(x)
> > > > > *** buffer overflow detected ***: /usr/lib/R/bin/exec/R terminated
> > > > > /lib/libc.so.6(__chk_fail+0x41)[0x1f1161]
> > > > > /lib/libc.so.6[0x1f0617]
> >
> > > > > does look like something that just Should Not Happen...
> 
> 
> I think valgrind shows the problem is in deparse.c:
>     245         strncpy(data, CHAR(STRING_ELT(svec, 0)), 10);
>     246         if (strlen(CHAR(STRING_ELT(svec, 0))) > 10) strcat(data, "...");
> You need to put a '\0' into data[10] after that strncpy
> so strcat can find the end of the string when the length
> of the copied string is >=10.  It currently runs into
> uninitialized memory at the end of ".Primitive".
> 
> (This is in a copy of R source from June 2006.)

Now fixed in 2.4.0 Patched and the development version.

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] eval(match.call()) (PR#9339)
Peter Dalgaard