Results 1 to 3 of 3

Thread: C programmers, check this out

  1. #1
    Guest

    C programmers, check this out


  2. #2
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re: C programmers, check this out

    That all sounds very good, but what if you're working with dynamicaly growing arrays, would this try to estimate the size of them ? or create some sort of double linked list to workaround the malloc(), calloc() and realloc() calls..

  3. #3

    Re: C programmers, check this out


    That all sounds very good, but what if you're working with dynamicaly growing arrays, would this try to estimate the size of them ? or create some sort of double linked list to workaround the malloc(), calloc() and realloc() calls..
    That's not what it does. If you have any assembly experience, you probably know that most compilers allocate memory in the order it is presented in the code. The thing with stack smashing comes from code like this:
    Code:
    char x[10];
    int * y;
    x[11]=12; // y now points to memory location 12
    Basically, this extension reorders the memory so it looks like this:
    Code:
    int * y;
    char x[10];
    x[11]=12;
    This way, if more memory is addressed than there is allocated, you do not have to worry about pointers being messed with.

Similar Threads

  1. Mail Check
    By gmoreno in forum Linux - General Topics
    Replies: 1
    Last Post: 03-01-2005, 05:29 PM
  2. Hardware check program in Linux
    By Compunuts in forum Linux - General Topics
    Replies: 3
    Last Post: 12-10-2004, 10:17 PM
  3. Books/Resources check this thread if you want tuts/manuals
    By maccorin in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 07-08-2004, 12:17 AM
  4. How to check GTK+
    By GhostDawg in forum Linux - Software, Applications & Programming
    Replies: 7
    Last Post: 06-16-2003, 01:45 AM
  5. Check this out folks!
    By cga in forum General Chat
    Replies: 10
    Last Post: 04-19-2002, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •