Description
In RedisCache.hpp:114, the copyReadBuffer method dereferences pElementsCopied without a null check on the early-return path, even though the parameter defaults to nullptr:
RA_Time copyReadBuffer(std::span<Type> destBuffer, int firstIndexToCopy = 0, int* pElementsCopied = nullptr)
{
// ...
if (copySourceStart >= sourceBuffer.end()) {
*pElementsCopied = 0; // CRASH: pElementsCopied defaults to nullptr
return RA_Time();
}
Line 119 correctly checks for null, but this early-return path on line 114 does not.
Severity
High
Suggested Fix
Add a null check: if (pElementsCopied) *pElementsCopied = 0;
Description
In
RedisCache.hpp:114, thecopyReadBuffermethod dereferencespElementsCopiedwithout a null check on the early-return path, even though the parameter defaults tonullptr:Line 119 correctly checks for null, but this early-return path on line 114 does not.
Severity
High
Suggested Fix
Add a null check:
if (pElementsCopied) *pElementsCopied = 0;