Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#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

    • assigned_to: nobody --> set
     
  • 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.

     
    • status: open --> closed