Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<>
- inline bool BundleReader::readArray<std::string>(
- unsigned int *length, std::vector<std::string> *values)
- {
- ....
- values->clear(); //<==
- if (*length > 0 && values) //<==
- {
- for (int i = 0; i < (int)*length; ++i)
- {
- values->push_back(readString());
- }
- }
- return true;
- }
- This suspicious code was found in Cocos2d-x project by PVS-Studio static code analyzer.
- Warning message is:
- V595 The 'values' pointer was utilized before it was verified against nullptr. Check lines: 188, 189. ccbundlereader.h 188
- 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