This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: help request: Usage of fopen() leading to heap overflows
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: Dragon <m dot giggey at utoronto dot ca>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 9 May 2007 10:26:55 +0100
- Subject: Re: help request: Usage of fopen() leading to heap overflows
- References: <200705091639.58904.m.giggey@utoronto.ca>
Dragon writes:
> My code compiles fine with gcc. 4.1.1
>
> gcc /home/path/indo18b.c -o /home/path/indo18b -lm -lz
> I have traced the offending line to the fopen statement. Read through all
> documentation I could find that indicates I am not doing anything really
> strange or wrong.
Yes, you are.
> Am I missing something?
>
> Please suggest solution....I am using Fedora Core 5. Embarrassingly, I admit I
> am unsure how to adjust the heap or stack.
You're trashing memory with a wild pointer write somewhere in your
code. Valgrind is a good tools to use at this point.
Andrew.