|
// Calculate the block size including encryption fields and padding if any. |
|
uint Archive::FullHeaderSize(size_t Size) |
|
{ |
|
if (Encrypted) |
|
{ |
|
Size = ALIGN_VALUE(Size, CRYPT_BLOCK_SIZE); // Align to encryption block size. |
|
if (Format == RARFMT50) |
|
Size += SIZE_INITV; |
|
else |
|
Size += SIZE_SALT30; |
|
} |
Filename: archive.cpp
Line: 291
CWE: 190 (Integer Overflow or Wraparound)
This arithmetic operation results in an integer overflow error. Because the result of this calculation is larger than the maximum possible value for this data type, the result may wrap to become a very small, or negative number, therefore providing an unintended value. Integer overflows can often trigger buffer overflows, which can be exploited to execute arbitrary code. Verify that the result of the calculation does not wrap around before passing the result into other functions. References: CWE/nDon't know how to fix this? Don't know why this was reported?
Get Assistance from Veracode
Sumatrapdf-cpp//ext/unrar/archive.cpp
Lines 286 to 296 in feca3c8
Filename: archive.cpp
Line: 291
CWE: 190 (Integer Overflow or Wraparound)
This arithmetic operation results in an integer overflow error. Because the result of this calculation is larger than the maximum possible value for this data type, the result may wrap to become a very small, or negative number, therefore providing an unintended value. Integer overflows can often trigger buffer overflows, which can be exploited to execute arbitrary code. Verify that the result of the calculation does not wrap around before passing the result into other functions. References: CWE/nDon't know how to fix this? Don't know why this was reported?
Get Assistance from Veracode