Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Repro Bug in CXTPSyntaxEditLexTagsAutomat
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Repro Bug in CXTPSyntaxEditLexTagsAutomat

 Post Reply Post Reply
Author
Message
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: Repro Bug in CXTPSyntaxEditLexTagsAutomat
    Posted: 04 August 2007 at 9:28am
I have a reproducible crash while loading an XML file in the method

CXTPSyntaxEditLexTagsAutomat::_FindWord

Visual C++ reports "Run-Time Check Failure #2 - Stack around the variable 'dwChar2' was corrupted." in the line


            WORD dwChar2 = 0;
            TCSNCCPY_S((LPTSTR)&dwChar2, sizeof(TCHAR) + 1, pcszBuffer, 1);
            rstrWord += (LPCTSTR)&dwChar2;


sizeof(TCHAR) + 1 is used to specify the size of the WORD stack variable, which fails when you compile in with _UNICODE defined.




Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2007 at 4:37pm
Hi,

Thanks, this has been already fixed for the next version. Below is the code update if needed:

if (m_ptrWordsMap_not)
{
    if (!m_ptrWordsMap_not->FindWord(bMinWord, pcszBuffer, rstrWord, nBufSize, bConvertToLowerCase, bIgnoreCaseDyn))
    {
        DWORD dwChar2 = 0;
        TCSNCCPY_S((LPTSTR)&dwChar2, 2, pcszBuffer, 1);
        rstrWord += (LPCTSTR)&dwChar2;
        return TRUE;
    }
}


--
WBR,
Serge
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2007 at 9:25am
Thanks.
I'll do the patch here and wait for the next release.
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.203 seconds.