Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
QSR 3.0
-
None
Description
Currently there is header field value fetching functions for both v3 and v4. They used to be more relevant when the parameter for header field offset was an enum (and even then it was not secure):
quint32 QSafeBitmapReader::getHeaderFieldV3(const quint32 *const bitmap32BitPtr, const quint32 headerFieldOffsetV3) { const quint32 value = SafeRendererGenerics::qFromBigEndian<quint32>(&bitmap32BitPtr[headerFieldOffsetV3]); return value; } quint32 QSafeBitmapReader::getHeaderFieldV4(const quint32 *const bitmap32BitPtr, const quint32 headerFieldOffsetV4) { const quint32 value = SafeRendererGenerics::qFromBigEndian<quint32>(&bitmap32BitPtr[headerFieldOffsetV4]); return value; }
These functions are identical, so they should be just one function.
Additionally, the header field offset could be checked against the size of the bitmap here and not leave the check only for the calling function.