Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!CPWSCA.PSC.EDU!GENTZEL From: GENTZEL@CPWSCA.PSC.EDU (Dave Gentzel) Newsgroups: gnu.emacs.bug Subject: Simple (but painful) bug in make_gap (18.54) Message-ID: <890627230913.20204a28@CPWSCA.PSC.EDU> Date: 28 Jun 89 03:09:13 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 13 make_gap() declares its argument as `int' when it should be `unsigned int'. This bug turned up as a result of the buggy VMS implementation of stat(). On an indexed file, it was returning -512 for st_size and since st_size is unsigned, it was a VERY large number. When passed to make_gap(), it was determined to be less than the current gap size (as -512 indeed is!) and make_gap() returned. Unfortunately, we now think the gap is big enough to hold the file and start stomping on random memory. Ouch! Had make_gap() declared its arg as unsigned, it would instead have generated an out-of-memory error when trying to realloc the buffer. Much more reasonable. Dave Gentzel Pittsburgh Supercomputing Center