#12 Access violation in TStringCollectionCIntl::freeItem()

closed
None
5
2008-02-26
2008-02-11
Anonymous
No

Hi,

if HAVE_INTL_SUPPORT is not defined, nointl.h header gets used and defines emptySt() as "return NULL". However, TStringCollectionCIntl::freeItem accesses the "translation" member of the stTVIntl struct which causes an access violation.

The fix is either to implement emptySt the same as in tvintl.cc, or to have freeItem() check the item parameter for NULL.

This is with 2.1.0 CVS20070425 pre-release, downloaded as rhtvision_2.1.0-3.src.tar.gz

Regards,
Peter Remmers

Discussion

  • Salvador Eduardo Tropea

    • assigned_to: nobody --> set
     
  • Salvador Eduardo Tropea

    Logged In: YES
    user_id=3906
    Originator: NO

    That's right, thanks!
    I fixed it on CVS:

    Index: classes/tcluster.cc

    RCS file: /cvsroot/tvision/tvision/classes/tcluster.cc,v
    retrieving revision 1.15
    retrieving revision 1.16
    diff -u -r1.15 -r1.16
    --- classes/tcluster.cc 10 Dec 2004 19:39:59 -0000 1.15
    +++ classes/tcluster.cc 26 Feb 2008 11:54:08 -0000 1.16
    @@ -45,7 +45,8 @@
    if( item )
    {
    stTVIntl *p = (stTVIntl *)item;
    - delete[] p->translation;
    + if( p->translation )
    + delete[] p->translation;
    delete p;
    }
    }
    ---------
    Please check if it fixes your problem.

     
  • Salvador Eduardo Tropea

    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks