Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class nsBaseStatis : public nsStatis {
- public:
- ...
- PRUint32 mLWordLen[10];
- ...
- nsBaseStatis::nsBaseStatis(
- unsigned char aL, unsigned char aH, float aR)
- {
- ...
- for(PRUint32 i = 0; i < 20; i++)
- mLWordLen[i] = 0;
- ...
- }
- }
- ...
- };
- This is what should have been written here: for(PRUint32 i = 0; i < 10; i++) or: for(PRUint32 i = 0; i < sizeof(mLWordLen)/sizeof(mLWordLen[0]); i++)
- This suspicious code was found in Firefox project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'i' index could reach 19. detectcharset.cpp 89
- 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