ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.17k stars 388 forks source link

`etl::multi_span::iterator::operator *()` fails if first `span` is empty #781

Closed dhebbeker closed 10 months ago

dhebbeker commented 11 months ago

If the first etl::span of an etl::multi_span is empty, the first call to etl::multi_span::iterator::operator*() will return a NULL pointer.

In contrast, if another span in the multi_span is empty (not the first), then etl::multi_span::iterator::operator ++() will check for empty spans and skip them correctly.

I suggest to add an appropriate check and skip in etl::multi_span::iterator::iterator(span_list_iterator, span_list_iterator).

jwellbelove commented 10 months ago

Fixed 20.38.7