func: void bad() wchar_t * data ; wchar_t dataBuffer [ FILENAME_MAX ] = BASEPATH ; data = dataBuffer; CWE23_Relative_Path_Traversal__wchar_t_environment_fopen_84_bad * badObject = new CWE23_Relative_Path_Traversal__wchar_t_environment_fopen_84_bad ( data ) ; CWE23_Relative_Path_Traversal__wchar_t_environment_fopen_84_bad::CWE23_Relative_Path_Traversal__wchar_t_environment_fopen_84_bad(wchar_t * dataCopy) data = dataCopy; size_t dataLen = wcslen ( data ) ; wchar_t * environment = GETENV ( ENV_VARIABLE ) ; if ( environment != NULL )  wcsncat ( data + dataLen , environment , FILENAME_MAX - dataLen - 1 ); delete badObject CWE23_Relative_Path_Traversal__wchar_t_environment_fopen_84_bad::~CWE23_Relative_Path_Traversal__wchar_t_environment_fopen_84_bad() FILE * pFile = NULL ; pFile = FOPEN ( data , L "wb+" ) if ( pFile != NULL )  fclose ( pFile ); 