![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to Read Error,jbase,voilation,segmentation words from a file | Mujtaba khan | Shell Programming and Scripting | 3 | 03-30-2008 01:19 PM |
| tar:read error: unexpected EOF | mikeruth | UNIX for Advanced & Expert Users | 4 | 01-18-2008 05:30 PM |
| How to prevent an application from closing a file | jasahl | AIX | 4 | 01-06-2008 09:39 PM |
| Error : no closing quote in unix | pinky | UNIX for Dummies Questions & Answers | 4 | 07-30-2007 02:38 PM |
| Hard error on read, OS error = 32 | Franzlebord | SUN Solaris | 0 | 05-18-2007 03:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Error closing read file
Every time I close a file that I opened for reading I get the following error: ”Memory fault(coredump)”. And, although it does not (I think) affect the overall process (I write another file based on the file I am reading); it is something I would rather not happen. I don’t know why this is happening but it is also not the only time. I am compiling with the following param: +DD64 -I ~/dev
I would be grateful for any help |
|
||||
|
This happens most often because:
the FILE *ptr has changed and no longer points to the FILE structure or points to an invalid struct. buffer overflow -- overwriting the stack -- is acommon way this ocurs. Code:
FILE *myfile=NULL;
char whatever[4]={0x0};
char *toobig="12341234";
myfile=fopen("something","r");
strcpy(whatever,toobig);
flcose(myfile);
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|