Skip to content

Commit

Permalink
Fix false fuzzer crash (#11326)
Browse files Browse the repository at this point in the history
The fuzzer report a null-pointer dereference which is not true. This
fixes that.

#### Link to tracking issue
Fixes https://issues.oss-fuzz.com/issues/42538213

Signed-off-by: Adam Korczynski <adam@adalogics.com>
  • Loading branch information
AdamKorcz authored Oct 1, 2024
1 parent af27e16 commit a24f914
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions receiver/otlpreceiver/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"

"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal/logs"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metrics"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal/trace"
Expand All @@ -35,6 +36,10 @@ func FuzzReceiverHandlers(f *testing.F) {
if err != nil {
panic(err)
}
r.nextTraces = consumertest.NewNop()
r.nextLogs = consumertest.NewNop()
r.nextMetrics = consumertest.NewNop()
r.nextProfiles = consumertest.NewNop()
resp := httptest.NewRecorder()
switch handler % 3 {
case 0:
Expand Down

0 comments on commit a24f914

Please sign in to comment.