FIX: DAO 3.6 overruns buffers in the GetRowsEx method (236056)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0, when used with:
- Microsoft Visual C++, 32-bit Professional Edition 6.0, when used with:
- Microsoft Visual C++, 32-bit Learning Edition 6.0, when used with:
This article was previously published under Q236056 SYMPTOMS
The character buffer allocated for string data is overrun when using the DAO SDK and the GetRowsEx method in non-unicode builds.
There are two ways character data can be fetched as described in the GetRows DAO SDK sample.
When using the dbBindSTRING method, the buffer is allocated dynamically, and the error message is one of the following: Error message 1
DAMAGE: after Normal block(#89) at <hex address>
Error message 2
DAMAGE: after Normal block(#99) at <hex address>
When using the dbBindLPSTRING method, some data can return truncated, not terminated by a null character, or garbled.
CAUSE
DAO version 3.6 incorrectly overwrites the character buffer supplied to it by the application when it fetches text data. It first copies the UNICODE string into the buffer which is twice as long as the length of the buffer and then converts the string to an ANSI string.
RESOLUTION
To work around this problem allocate twice the space necessary if the direct binding method is used, or allocate enough space for an extra record if the indirect method is used as described in the "More Information" section.
This problem has been fixed in DAO 3.60 version 3.60.3714.5. To obtain the updated DAO 3.60 dll, install the latest Microsoft Jet 4.0 service pack.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
239114
How to obtain the latest service pack for the Microsoft Jet 4.0 Database Engine
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
This problem was corrected in Microsoft Jet 4.0 Service Pack 4.
REFERENCES
For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
235507
FIX: You receive a "DAMAGE: after Normal block (#204)" debug error message when you convert a MFC DAO application to use DAO 3.6 in Visual C++
194022 Visual Studio 6.0 service packs, what, where, why
Modification Type: | Major | Last Reviewed: | 9/1/2005 |
---|
Keywords: | kbQFE kbBug kbDatabase kbfix KB236056 kbAudDeveloper |
---|
|