cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

julien2412 serval2412 at yahoo.fr
Mon Jan 19 13:52:41 PST 2015


sberg wrote
> ...
> That m_pData is a "flexible array member" whose actual length is 
> controlled dynamically.  Cppcheck could probably make use of a heuristic 
> to treat a trailing member declared as an array of length 1 as such a 
> flexible array, as do some other static analysis tools.

Thank you Stephan.
I put a comment to suppress this warning (see
http://cgit.freedesktop.org/libreoffice/core/commit/?id=ac8fdc7dd4f8ff8d896402838323c65e12c03e7c).
However, I'm not sure to understand.
I mean, I thought there were mere array (like in C) with fixed size and
vector or other dynamic containers.
I don't know what you mean by "flexible array member" but above all what
about if "n" (so  capacityCount()) is 1?
m_pData[1] would be out of bounds, wouldn't it?
I tried to Google a bit but didn't find something relevant.

Julien



--
View this message in context: http://nabble.documentfoundation.org/cppcheck-arrayIndexOutOfBounds-report-in-stortree-cxx-store-module-tp4136432p4136718.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list