Views
No views yet
TensorShape::GetNumElements() in src/armnn/Tensor.cpp:190-197 multiplies tensor dimensions using unsigned int without overflow checking.GetNumElements() returns 0. This propagates to GetNumBytes() (line 429), which is used for ALL buffer allocation and validation. The buffer size check at TfLiteParser.cpp:270-271 compares against the overflowed value (0 > N = false), so validation silently passes.1// Tensor.cpp:190-197
2unsigned int count = 1;
3for (unsigned int i = 0; i < m_NumDimensions; ++i)
4{
5 if (m_DimensionsSpecificity[i])
6 {
7 count *= m_Dimensions[i]; // NO OVERFLOW CHECK
8 }
9}OnnxParser.cpp:2332 uses reserve() instead of resize(), then accesses elements by index (UB/OOB write).numeric_cast overflow checks disabled in release builds (NDEBUG)