open-telemetry / opentelemetry-go-contrib

Collection of extensions for OpenTelemetry-Go.
https://opentelemetry.io/
Apache License 2.0
1.08k stars 505 forks source link

Fix panic caused by invalid spanId with b3 propagator #5753

Closed Cirilla-zmh closed 2 weeks ago

Cirilla-zmh commented 2 weeks ago

Background

When using the b3 single propagator, the presence of an invalid spanId in the request can trigger a panic.

Cause

The panic occurs due to an array index out-of-bounds error when parsing the SpanID without proper length checks for invalid spanIds.

Fix

Added a length check for SpanID to prevent this panic by ensuring spanIds are of valid length before processing.

linux-foundation-easycla[bot] commented 2 weeks ago

CLA Missing ID CLA Not Signed