grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.96k stars 3.46k forks source link

fix: remove usage of unsafe string in label adapter unmarshal #14216

Closed ashwanthgoli closed 1 month ago

ashwanthgoli commented 1 month ago

What this PR does / why we need it:

Unmarshal method of LabelAdapter was using yoloString to reference parts of a bytes buffer alloced by grpc lib. But with release 1.66.0, grpc introduces a new codec that reuses buffers. Referencing parts of these buffers is not safe anymore since these bytes could get cleared or replaced by other messages.

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Checklist