mirror of
https://github.com/etcd-io/etcd.git
synced 2026-12-03 10:36:24 +08:00
mkGteRange passed a zero-length but non-nil range end through unchanged,
and the MVCC index served it as an open-ended range, while the auth
check treats a zero-length range end as a single key. A non-nil empty
range end can reach it from a hand-crafted request on branches whose
protobuf decoder keeps a present-but-empty field as []byte{}, or from
an in-process caller on any branch.
Normalize a zero-length range end to nil so the logic is correct
regardless of the decoder. "\x00" still maps to []byte{} (the >= key
form).
Signed-off-by: Gaurav Pande <garvpande11235@gmail.com>