clboss icon indicating copy to clipboard operation
clboss copied to clipboard

Avoid vector out of bounds access in ParserExposedBuffer.cpp

Open vasild opened this issue 1 year ago • 1 comments

Accessing elements past the size of a std::vector is undefined behavior [1] and is actually checked in recent versions of LLVM libcxx, which is used in FreeBSD [2].

[1] https://en.cppreference.com/w/cpp/container/vector/operator_at:

Accessing a nonexistent element through this operator is undefined behavior.

[2] https://cgit.freebsd.org/src/tree/contrib/llvm-project/libcxx/include/vector?h=2472e352d80fcf6440fd42fbb16960cc49d05b03#n1393

vasild avatar Jun 26 '24 08:06 vasild

@vasild Thanks for submitting ... will look

ksedgwic avatar Jun 28 '24 18:06 ksedgwic