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

Patch: Certain error conditions are handled incorrectly in COM methods

From: Dmitry <wipedout_at_yandex.ru>
Date: Thu, 17 Sep 2009 09:40:24 +0400

Hey.

In TSVN certain error conditions in COM methods are handled incorrectly:
1. Sometimes no checks for null pointers are performed and those pointers are later dereferenced.
2. Sometimes E_INVALIDARG is returned when a pointer to an "out" parameter is null. E_POINTER should be returned instead.
3. Sometimes S_FALSE is returned for incorrect arguments. S_FALSE evaluates "FAILED()" macro to "false" and is a way to indicate that the call has completed successfully but either the answer to the query is "no, thank you" or the query has obtained less results than requested. Such misuse is an example of error hiding.
4. Sometimes an object is created with "new" and IUnknown::QueryInterface() is called in it without a check for whether that call succeeded and that can cause a memory leak.

A patch is proposed.

Dmitry.

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

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

Received on 2009-09-17 09:41:59 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.