Panic index out of range when receiving message from eventhub #250
Open
Description
I found this loc is not check len of msg.Data
which causing panic: runtime error: index out of range [0] with length 0
when receiving message from eventhub
Line 217 in 73b7c0f
Expected Behavior
It can run properly
Actual Behavior
│ panic: runtime error: index out of range [0] with length 0
│ goroutine 105 [running]:
│ github.com/Azure/azure-event-hubs-go/v3.eventFromMsg(...)
│ /go/pkg/mod/github.com/!azure/azure-event-hubs-go/v3@v3.3.17/event.go:217
│ github.com/Azure/azure-event-hubs-go/v3.(*receiver).handleMessage(0xc0004b4000, 0x1815dd0, 0xc0000c4940, 0xc00063e2d0, 0xc0006b80a0)
│ /go/pkg/mod/github.com/!azure/azure-event-hubs-go/v3@v3.3.17/receiver.go:251 +0x75f
│ github.com/Azure/azure-event-hubs-go/v3.(*receiver).handleMessages(0xc0004b4000, 0x1815dd0, 0xc0000c4940, 0xc0002de900, 0xc0006b80a0)
│ /go/pkg/mod/github.com/!azure/azure-event-hubs-go/v3@v3.3.17/receiver.go:243 +0x106
│ created by github.com/Azure/azure-event-hubs-go/v3.(*receiver).Listen
│ /go/pkg/mod/github.com/!azure/azure-event-hubs-go/v3@v3.3.17/receiver.go:227 +0x18c
Environment
- OS: alpine
- Go version: 1.16
- Version of Library: v3.3.17
Metadata
Assignees
Labels
No labels