Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SZ_RESULT SafeReadDirectUInt64(ISzInStream *inStream,
- UInt64 *value)
- {
- int i;
- *value = 0;
- for (i = 0; i < 8; i++)
- {
- Byte b;
- RINOK(SafeReadDirectByte(inStream, &b));
- *value |= ((UInt32)b << (8 * i));
- }
- return SZ_OK;
- }
- This suspicious code was found in lib7z project by PVS-Studio static code analyzer.
- Warning message is:
- V610 Undefined behavior. Check the shift operator '<<. The right operand ('(8 * i)' = [0..56]) is greater than or equal to the length in bits of the promoted left operand. lib7z 7zin.c 233
- 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