Bugs fixing-dangling pointer

Discussion in 'C' started by karthick_24, Feb 26, 2008.

  1. karthick_24

    karthick_24 New Member

    Joined:
    Feb 26, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I find very difficult to fix the dangling pointer bug occurred in my new open source office application developed in C++ language. I need some information to resolve this bug?
     
  2. tommy

    tommy New Member

    Joined:
    Feb 26, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Coverity-Source code analysis

    Hi,
    Usually dangling pointers arises when an object is deleted or deallocated , without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory. As the system may reallocate the previously freed memory to another process, if the original program then dereferences the (now) dangling pointer, unpredictable behavior may result, as the memory may now contain completely different data. This is especially the case if the program writes data to memory pointed by a dangling pointer, as silent corruption of unrelated data may result, leading to subtle bugs that can be extremely difficult to find, or cause segmentation faults. You didn’t mention the code for resolving the bug.
     
    Last edited by a moderator: Mar 11, 2008
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    No self promotion in posts. Please use the signature for that.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice