Files
scylla/keys.hh
Kefu Chai 1ab2bb69b8 keys: do not use zip_iterator for printing key components
boost's the operator==() implementation of boost's zip_iterator
returns true only if all elements in enclosed tuple of zip_iterator
are equal. and the zip_iterator always advances all the iterators in
the enclosed tuple. but in our case, some components might be missing.
in other words, the size of the `components` might be smaller than
that of the `types` range. so, when the zip_iterator advances past
the end of the components, scylla starts reading out of bounds.

because zip_iterator does not allow us to customize how it implements
the equal operator. and we cannot deduce the size of components without
reading all of them. so in this change, we partially revert
3738fcbe05, instead of using fmt::join(),
just iterate through the components manually. this should avoid
the out-of-bound reading, and also preserve the original behavior.

Branches: 5.3
Fixes #14435
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #14457
2023-07-01 23:49:02 +03:00

34 KiB