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

encoding/asn1: call of reflect.Value.Type on zero Value #11127

Closed
dvyukov opened this issue Jun 9, 2015 · 1 comment
Closed

encoding/asn1: call of reflect.Value.Type on zero Value #11127

dvyukov opened this issue Jun 9, 2015 · 1 comment
Milestone

Comments

@dvyukov
Copy link
Member

@dvyukov dvyukov commented Jun 9, 2015

The following program crashes with the panic:

package main

import "encoding/asn1"

func main() {
    var v interface{}
    asn1.Marshal(v)
}
panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)
    src/reflect/value.go:1664 +0x7b
encoding/asn1.marshalField(0xc20807deb0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    src/encoding/asn1/marshal.go:536 +0x540
encoding/asn1.Marshal(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    src/encoding/asn1/marshal.go:646 +0x14d
main.main()
    asn1.go:7 +0x2d

Marshal should return an error instead.

on commit b0532a9

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 9, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 26, 2015

CL https://golang.org/cl/13923 mentions this issue.

@agl agl closed this in fac1039 Aug 29, 2015
@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.