[Info-vax] Text processing examples with Fortran requested
Richard B. Gilbert
rgilbert88 at comcast.net
Tue Nov 17 07:59:11 EST 2009
Michael Kraemer wrote:
> In article <4b0209e1$0$274$14726298 at news.sunsite.dk>, =?ISO-8859-1?Q?Arne_Vajh=F8j?= <arne at vajhoej.dk> writes:
>> Dynamic memory allocation does not prevent buffer overflow.
>>
>> Checking available length does.
>>
>> I fact there are many more buffer overflows in C than in Fortran.
>
> Is there a metric for that or just a wild guess ?
> Probably people do things in C that you won't even try in Fortran.
> I guess that most buffer overflows arise from programmers being
> too lazy to use dynamic allocation, using fixed length buffers.
Dynamic allocation is not the answer! Allocating ENOUGH SPACE solves
most problems. Checking the length of what you want to put in a buffer
against the actual length of the buffer works wonders! Trying to put
five pounds in a two pound bag is a recipe for crashes and other
mysterious behavior.
More information about the Info-vax
mailing list