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 on pad #27

Closed
danf0rth opened this issue Jun 3, 2019 · 3 comments
Closed

panic on pad #27

danf0rth opened this issue Jun 3, 2019 · 3 comments
Labels

Comments

@danf0rth
Copy link

danf0rth commented Jun 3, 2019

In some cases the panic occurred when called SendNotification method.

go version go1.12.1 linux/amd64
also tried
go version go1.12.5 linux/amd64

runtime.gopanic
        /usr/local/go/src/runtime/panic.go:522
runtime.panicmakeslicelen
        /usr/local/go/src/runtime/slice.go:27
runtime.makeslice
        /usr/local/go/src/runtime/slice.go:44
github.com/SherClockHolmes/webpush-go.pad
        /home/danforth/Dev/go/pkg/mod/github.com/!sher!clock!holmes/[email protected]/webpush.go:250
github.com/SherClockHolmes/webpush-go.SendNotification
        /home/danforth/Dev/go/pkg/mod/github.com/!sher!clock!holmes/[email protected]/webpush.go:169

@gbhrdt
Copy link

gbhrdt commented Jun 14, 2019

I think I've seen something similar when using a too big payload.

@danf0rth
Copy link
Author

danf0rth commented Jun 14, 2019

@gbhrdt yes, just yesterday we tried to reduce our payloads and bug is gone. Today we try to increase payload again and the problem still not appears, moreover, our payloads now is even bigger then before, when the panic occurs, but the problem is gone and everything works fine. I not sure, maybe the problem was in header

@pierrre
Copy link

pierrre commented Sep 16, 2019

I also have this issue:

  • webpush-go version: v1.0.1 (I'll try to upgrade)
  • Go version: 1.12.1

For now, I will defer/recover the panic in my code.

abustany added a commit to abustany/webpush-go that referenced this issue Oct 9, 2019
This commit fixes a case where, with large notification payloads, pad
would call make with a negative length, triggering a panic.
abustany added a commit to abustany/webpush-go that referenced this issue Oct 9, 2019
This commit fixes a case where, with large notification payloads, pad
would call make with a negative length, triggering a panic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants