[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Patch: auto_ptr is frequently abused in TSVN code

From: Dmitry <wipedout_at_yandex.ru>
Date: Thu, 27 Aug 2009 12:30:19 +0400

Hey.

In TSVN sources std::auto_ptr is often used for controlling arrays. This works by pure luck. auto_ptr destructor invokes delete but the array has been allocated with new[]. Pairing new[] with delete instead of with delete[] is undefined behaviour. This works because for primitive types VC++ maps new[] onto new but it might stop working with another version of C++ compiler.

Fixed this in two patches.

Best wishes.
Dmitry.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2387817

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2009-08-27 10:39:22 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.