func: void bad() wchar_t * data ; wchar_t dataBuffer [ FILENAME_MAX ] = BASEPATH ; data = dataBuffer; CWE23_Relative_Path_Traversal__wchar_t_listen_socket_fopen_84_bad * badObject = new CWE23_Relative_Path_Traversal__wchar_t_listen_socket_fopen_84_bad ( data ) ; CWE23_Relative_Path_Traversal__wchar_t_listen_socket_fopen_84_bad::CWE23_Relative_Path_Traversal__wchar_t_listen_socket_fopen_84_bad(wchar_t * dataCopy) data = dataCopy; WSADATA wsaData ; int wsaDataInit = 0 ; int recvResult ; struct sockaddr_in service ; wchar_t * replace ; SOCKET listenSocket = INVALID_SOCKET ; SOCKET acceptSocket = INVALID_SOCKET ; size_t dataLen = wcslen ( data ) ; if ( WSAStartup ( MAKEWORD ( 2 , 2 ) , & wsaData ) != NO_ERROR )  break ; wsaDataInit = 1; listenSocket = socket ( AF_INET , SOCK_STREAM , IPPROTO_TCP ); if ( listenSocket == INVALID_SOCKET )  break ; memset ( & service , 0 , sizeof ( service ) ); service . sin_family = AF_INET; service . sin_addr . s_addr = INADDR_ANY; service . sin_port = htons ( TCP_PORT ); if ( bind ( listenSocket , ( struct sockaddr * ) & service , sizeof ( service ) ) == SOCKET_ERROR )  break ; if ( listen ( listenSocket , LISTEN_BACKLOG ) == SOCKET_ERROR )  break ; acceptSocket = accept ( listenSocket , NULL , NULL ); if ( acceptSocket == SOCKET_ERROR )  break ; recvResult = recv ( acceptSocket , ( char * ) ( data + dataLen ) , sizeof ( wchar_t ) * ( FILENAME_MAX - dataLen - 1 ) , 0 ); if ( recvResult == SOCKET_ERROR || recvResult == 0 )  break ; data [ dataLen + recvResult / sizeof ( wchar_t ) ] = L '\0' replace = wcschr ( data , L '\r' ) if ( replace )  * replace = L '\0' replace = wcschr ( data , L '\n' ) if ( replace )  * replace = L '\0' while ( 0 )  if ( listenSocket != INVALID_SOCKET )  CLOSE_SOCKET ( listenSocket ); if ( acceptSocket != INVALID_SOCKET )  CLOSE_SOCKET ( acceptSocket ); if ( wsaDataInit )  WSACleanup ( ); delete badObject CWE23_Relative_Path_Traversal__wchar_t_listen_socket_fopen_84_bad::~CWE23_Relative_Path_Traversal__wchar_t_listen_socket_fopen_84_bad() FILE * pFile = NULL ; pFile = FOPEN ( data , L "wb+" ) if ( pFile != NULL )  fclose ( pFile ); 