Skip to content

Commit

Permalink
fix(baggage): validate chars panic with 0x80 (open-telemetry#5494)
Browse files Browse the repository at this point in the history
The validation rule for baggage key/values chars has a N+1 problem with
the unicode value: `0x80`.

For instance, `baggage.NewMemberRaw` could be called with a string value
including the rune `128` and return no error.

Then `baggage.New` would panic on `validateValueChar`:
```
=== RUN   TestValidateValueChar
--- FAIL: TestValidateValueChar (0.00s)
panic: runtime error: index out of range [128] with length 128 [recovered]
	panic: runtime error: index out of range [128] with length 128
```

---------

Co-authored-by: Sam Xie <sam@samxie.me>
  • Loading branch information
2 people authored and OrHayat committed Jun 23, 2024
1 parent 5488db6 commit dea074e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their coresponding environment variables in in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508)
- Fix stale timestamps reported by the lastvalue aggregation. (#5517)
- Run the `Detect` method in `go.opentelemetry.io/otel/sdk/resource` in parallel. (#5402)
- Fix panic in baggage creation when a member contains 0x80 char in key or value. (#5494)

## [1.27.0/0.49.0/0.3.0] 2024-05-21

Expand Down

0 comments on commit dea074e

Please sign in to comment.