Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Tainted

The Tainted property specifies whether a value is safe for use by other functions. This property is allowed on Pre and Post attributes and can be applied to any data type.

The Tainted property must be set by using one of the following values:

  • SA_Yes - the value is tainted and cannot be trusted.

  • SA_No - the value is not tainted and can be trusted.

  • SA_Maybe - the value might be tainted and cannot be trusted.

The C6029 code analysis warning is fired if the value of a parameter that is marked [Post(Tainted=Yes)] is immediately passed to a parameter that is marked [Pre(Tainted=No)].

The following code shows how to use the Tainted property:

// C 
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(Tainted=SA_Yes)] int c);

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre(Tainted=Yes)] int c);m

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.