Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic index out of range when receiving message from eventhub #250

Open
buicongtan1997 opened this issue Mar 29, 2022 · 0 comments
Open

Comments

@buicongtan1997
Copy link

buicongtan1997 commented Mar 29, 2022

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

return newEvent(msg.Data[0], msg)

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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/receiver.go:227 +0x18c

Environment

  • OS: alpine
  • Go version: 1.16
  • Version of Library: v3.3.17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant