[R] main/character.c (et.al): dangerous AllocBuffer()

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
13 Oct 1999 17:05:10 +0200


Thomas Hoffmann <hoffmann@ehmgs2.et.tu-dresden.de> writes:

> When called with len<0 the code is assumed to re-size buff to MAXELTSIZE:
> 
> 	realloc(buff, 0);
> 	buff = (char *) realloc(buff, MAXELTSIZE);
> 	bufsize = MAXELTSIZE;
--etc--

Fixed as suggested (free+malloc)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._