Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Missing pointer test
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Missing pointer test

 Post Reply Post Reply
Author
Message
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Topic: Missing pointer test
    Posted: 17 October 2012 at 10:39am
Hello,

We are having a crash there :

CXTPReportColumn* CXTPReportColumns::Find(int nItemIndex) const
{
        for (int nColumn = 0; nColumn < GetCount(); nColumn++)
        {
                CXTPReportColumn* pColumn = GetAt(nColumn);
                if (pColumn->GetItemIndex() == nItemIndex)
                        return pColumn;
        }
        return NULL;
}

We are having a case where the method GetAt(...) returns NULL, and the variable pColumn is NULL. You access directly to a member method of that variable without checking for its validity.

Our temporary workaround is to code our own Find method.

Please fix that for the next release, as we use the Find in many other parts of the code.

Thank you.

Sergio
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2012 at 5:26pm
I ran into the same crash, but in my case it's not reproduceable all the time!

Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.