[libc++] span: Guard against overflow in span::subspan
The calculation _Offset + _Count <= size() may overflow, so use _Count <= size() - _Offset instead. Note that this is safe due to the previous constraint that _Offset <= size(). Patch by Michael Schellenberger Costa. Differential Revision: https://reviews.llvm.org/D71998
Loading
Please register or sign in to comment