bug in standard library implementation in C++Builder 6, Update 4

Dear,

I write about a bug, but I suspect someone has already found it in the past.

Th bug can be seen by using

std::vector::resize((unsigned int)-1)

because of the implementation of std::vector has size_type<->unsigned int
but at low level the memory manager allocates data blocks through a signed int size parameter.

In particular,

std::vector::_M_insert_overflow
calls
std::allocator
that calls
std::__node_alloc::allocate
that calls
__stl_new
that calls
___org_new
that calls
malloc
that calls
__internal_malloc
that calls
System::SysGetMem
and System::SysGetMem compares the size with 0x7fFfFf80
and then just allocates max( 12, (((-1)+7) & 0x04) ) bytes,
but then 
std::vector::_M_insert_overflow
calls __copy_trivial which writes zero eveywhere, corrupting all data.


Best Regards,
Mauro Russo.
0
mauro
11/17/2010 5:07:02 PM
embarcadero.cppbuilder.tools 1275 articles. 0 followers. Follow

0 Replies
587 Views

Similar Articles

[PageSpeed] 54
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

ANN: Localizer 4.6.0
We are glad to announce Localizer 4.6.0 release. Localizer is a localization/globalization tool kit for Embarcadero Delphi or C++ Builder. Using it you can get one executable file that supports as many languages as you want. Localizer can process all string resources in your project: component properties, resource string constants, VCL messages and the messages from the third-party packages. You can also change size and position of the controls in different languages. Support for additional language(s) can be added without recompilation of the project even by your end users. Localize...

C++Builder 2010 Update 4/5
Asking this question here first to see if there are any known or quick resolutions. Running C++Builder 2010, I updated with Update 2/3/Boost when they were initially released and then again with Update 4/5/Boost this week. After each of these showed no errors on installation and Updates 4/5/Boost (+Help) show in my Installed Updates list, but the file versions remain Build 3513. Embarcadero® C++Builder® 2010 Version 14.0.3513.24210 (bcc32.exe reports version 6.20). I am running Windows XP SP3 and the initial product along with the updates were installed by the same & only u...

superreview requested: [Bug 208314] MSVC++ .net 2003: Requires new Standard C++ Library (iostream, iomanip, fstream, et al) : [Attachment 140451] updated patch
tor@acm.org has asked David Baron <dbaron@dbaron.org> for superreview: Bug 208314: MSVC++ .net 2003: Requires new Standard C++ Library (iostream, iomanip, fstream, et al) http://bugzilla.mozilla.org/show_bug.cgi?id=208314 Attachment 140451: updated patch http://bugzilla.mozilla.org/attachment.cgi?id=140451&action=edit ...

superreview granted: [Bug 208314] MSVC++ .net 2003: Requires new Standard C++ Library (iostream, iomanip, fstream, et al) : [Attachment 140451] updated patch
David Baron <dbaron@dbaron.org> has granted tor@acm.org's request for superreview: Bug 208314: MSVC++ .net 2003: Requires new Standard C++ Library (iostream, iomanip, fstream, et al) http://bugzilla.mozilla.org/show_bug.cgi?id=208314 Attachment 140451: updated patch http://bugzilla.mozilla.org/attachment.cgi?id=140451&action=edit ...

superreview granted: [Bug 208314] MSVC++ .net 2003: Requires new Standard C++ Library (iostream, iomanip, fstream, et al) : [Attachment 139120] remove *stream patch update to tip
David Baron <dbaron@dbaron.org> has granted David Baron <dbaron@dbaron.org>'s request for superreview: Bug 208314: MSVC++ .net 2003: Requires new Standard C++ Library (iostream, iomanip, fstream, et al) http://bugzilla.mozilla.org/show_bug.cgi?id=208314 Attachment 139120: remove *stream patch update to tip http://bugzilla.mozilla.org/attachment.cgi?id=139120&action=edit ------- Additional Comments from David Baron <dbaron@dbaron.org> I looked over this quickly, and I delegate the remainder of my sr= to gcc. If you build this with a recent version of gc...

Using Xercesc C++ XML parser library with C++ builder 6
hi i am working on a project built in c++ builder 4 that uses Xercesc C++ XML parser v1.5.1, now i am trying to upgrade that to c++ builder 6. I have few queries related to it. 1. whether we can use the v1.5.1 for the c++ builder 6 2. how to build xercesc library 3. whether using the current version of xercesc library will be cause any issues since the project uses v1.5.1 Thanks. ...

updated from GW 6.5.4 to GW 6.5.6 but agents still run at 6.5.4
I recently attempted to update from GW 6.5.4 to GW 6.5.6. I ran the service pack and followed direction very closely, and once I finished updating the Primary Domain and the Post Office, I check marked to update the startup files and to launch the MTA and PO. When they launched after my update they were running at 6.5.6, but when I reset the server they went back to running at 6.5.4. I also need to update the GWIA and the WebAccess Agent. Do I have to do those separately? This is really the first time that I have ever patched a GW System. Are there more detailed instructi...

WSUS Offline Update 6.4 (formerly c't offline update)
http://wsusoffline.net/ "At this site, the open source project formerly known as "c't offline update" or "DIY Service Pack" and published at "The H", will be continued by its original author, Torsten Wittrock. Using "WSUS Offline Update", you can update any computer running Microsoft Windows safely, quickly and without an Internet connection. As licensed under 'GNU GPL', you still may download and use the software from this site for free." Version 6.4 released February 12, 2010: http://download.wsusoffline.net/ ...

C++Builder 2010: same old bugs.... goodbye, C++Builder.
I've tried the demo version, built my OCX, set the constrained size, and added some event handler. It works exactly like the old Borland CBuilder 6: the grab handles does not follow the constrained size, the OnCloseQuery and OnDestroy events are not fired, there's is not an OnAmbientChange event available. Building OCX is an important feature for us, as our customer needs them... so, if i were the one that take the final decision, i'll migrate to MS developement tools.... i'm not that one, but i'll strongly push in that direction. It's a shame, anyway. If yo...

Convert to C++ Builder XE from C++ Builder 6 and 2007
Any information regarding the roadblocks of converting the code build in C++ Builder 6,2007 to C++ Builder XE? On 6/20/2012 8:20 AM, Girish Duddu wrote: > Any information regarding the roadblocks of converting the code build in C++ Builder 6,2007 to C++ Builder XE? The big change is the default string in XE is UnicodeString rather than AnsiString. All VCL String properites (Text, etc.) are Unicode in XE. There are good white papers regarding making this transition on the Embarcadero EDN site. I found that most of the changes I had to make fell into two categories: 1) Places...

Upgrading Code from C++ Builder 4 to C++ Builder 2007
I am working on project written in C++ Builder 4, it uses TMS Component pack. Now the TMS Component pack has been upgraded so i do not find any compatible version of TMS Component to use with C++ Builder 4. I need to upgrade my code from C++ Builder 4 to C++ Builder 2007. I want to know whether code written in C++ Builder 4 is feasible with C++ Builder 2007. Thanks Arshdeep wrote: > I want to know whether code written in C++ Builder 4 is feasible > with C++ Builder 2007. Feisible, but do take into account that there have been RTL/VCL changes between BCB4 and CB2007, so y...

problem of converting from C++ Builder 6 to C++ Builder 2007
Hi, A program which was developed by our partner was built fine with C++ Builder 6. Now I need to make some changes to it. We bought C++ Builder 2007 a few weeks ago. When I open the program with C++ Builder 2007, I was told that the project needs to be converted. I agreed. Then when I compile it, some errors happen: [BCC32 Error] ComCtrls.hpp(435): E2272 Identifier expected [BCC32 Error] ComCtrls.hpp(3880): E2272 Identifier expected [BCC32 Error] ComCtrls.hpp(4658): E2272 Identifier expected ...... Anybody has any idea how to fix it? Thanks, Allen In article <14040@f...

superreview denied: [Bug 304239] Fix issues in NSPR's real_install makefile target : [Attachment 192310] Report NSPR 4.6's version as "4.6" instead of "4.6.0"
Chris Seawood <cls@seawood.org> has denied Wan-Teh Chang <wtchang@redhat.com>'s request for superreview: Bug 304239: Fix issues in NSPR's real_install makefile target https://bugzilla.mozilla.org/show_bug.cgi?id=304239 Attachment 192310: Report NSPR 4.6's version as "4.6" instead of "4.6.0" https://bugzilla.mozilla.org/attachment.cgi?id=192310&action=edit ------- Additional Comments from Chris Seawood <cls@seawood.org> I don't like this kind of special casing. And the checks in nspr.m4 & values in mozilla-nspr.pc would ...

superreview requested: [Bug 304239] Fix issues in NSPR's real_install makefile target : [Attachment 192310] Report NSPR 4.6's version as "4.6" instead of "4.6.0"
Wan-Teh Chang <wtchang@redhat.com> has asked Chris Seawood <cls@seawood.org> for superreview: Bug 304239: Fix issues in NSPR's real_install makefile target https://bugzilla.mozilla.org/show_bug.cgi?id=304239 Attachment 192310: Report NSPR 4.6's version as "4.6" instead of "4.6.0" https://bugzilla.mozilla.org/attachment.cgi?id=192310&action=edit ------- Additional Comments from Wan-Teh Chang <wtchang@redhat.com> Will dropping the 0 patch level break any script (e.g., mozilla's --with-system-nspr configure option)? ...

Web resources about - bug in standard library implementation in C++Builder 6, Update 4 - embarcadero.cppbuilder.tools

Ministry of Statistics and Programme Implementation - Wikipedia, the free encyclopedia
The Ministry of Statistics and Programme Implementation came into existence as an Independent Ministry on 15.10.1999 after the merger of the ...

Facebook Re-Examining Its Privacy Changes; Delays Their Implementation
... of the changes to its data use policy and statement of rights and responsibilities , announced last week, Facebook said it will delay the implementation ...

Will Virgin America President/CEO David Cush lose his job over the Sabre implementation disaster?
com/vx/... According to their website, Virgin initial planned to complete the migration in a single weekend and thinned out their flight schedule ...

5.15.13 Patent Reform Implementation and New Challenges for Small Businesses - YouTube
On Wednesday, May 15, 2013, at 1:00 P.M., the Committee on Small Business held a hearing titled, "Patent Reform Implementation and New Challenges ...

Project Manager - Salesforce Implementation
Information Technology strategy insight for senior IT management - resources to understand and leverage information technology.

Project Manager - Salesforce Implementation
Computerworld Australia is the leading source of technology news, analysis and tools for IT decision makers, managers and professionals.

A fair VCE: its design and implementation
The VCAA manages the system in which VCE students' work is assessed and the key focus is ensuring the process and system is fair.

IOC demands Russia explain implementation of its anti-gay law
Olympic president Jacques Rogge has called on Russia to explain how it will implement its controversial anti-gay propaganda law and detail its ...

Iran seeks nuclear deal implementation, but enrichment issues block progress
Nearly seven weeks after signing a landmark nuclear deal, Iran and six world powers hope to reach an agreement this week on its implementation. ...

Budget Implementation Bill To Be Studied By 9 Committees
The Canadian government is backing down slightly on its mammoth budget implementation bill and has agreed to send it to 10 different committees ...

Resources last updated: 12/19/2015 8:00:47 AM