Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- size_t UTF16BeDecodeChar(BYTE* pBytes, size_t nNumBytes,
- TCHAR arrChar[2], size_t& nCharSize)
- {
- if (UTF16BeToLeChar(pBytes, nNumBytes) < 0)
- {
- nCharSize = MAXSIZE_T;
- return 0;
- }
- return UTF16LeDecodeChar(pBytes, nNumBytes,
- arrChar, nCharSize);
- }
- In case of an error, the UTF16BeToLeChar() function returns MAXSIZE_T. This case will be handled incorrectly.
- This suspicious code was found in Shareaza project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression is always false. Unsigned type value is never < 0. BugTrap encoding.cpp 425
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment