encoding/asn1: Marshal panics if given *big.Int == nil #17461
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
no panic.
What did you see instead?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x9ab8a]
goroutine 1 [running]:
panic(0xb9280, 0x13d250)
/Users/hiro/go/src/runtime/panic.go:527 +0x1a0
encoding/asn1.makeBigInt(0x0, 0x0, 0x16)
/Users/hiro/go/src/encoding/asn1/marshal.go:154 +0x3a
encoding/asn1.makeBody(0xcf640, 0x0, 0x16, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e6038, ...)
/Users/hiro/go/src/encoding/asn1/marshal.go:412 +0x1301
encoding/asn1.makeField(0xcf640, 0x0, 0x16, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/hiro/go/src/encoding/asn1/marshal.go:596 +0x2b4
encoding/asn1.Marshal(0xcf640, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4200001a0)
/Users/hiro/go/src/encoding/asn1/marshal.go:641 +0xe6
main.main()
/Users/hiro/a.go:15 +0x39
exit status 2
Does this issue reproduce with the latest release (go1.7.1)?
System details
The text was updated successfully, but these errors were encountered: