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 when getting credential #5

Closed
emersion opened this issue Aug 5, 2016 · 3 comments
Closed

Panic when getting credential #5

emersion opened this issue Aug 5, 2016 · 3 comments

Comments

@emersion
Copy link

emersion commented Aug 5, 2016

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0x838dbe]

goroutine 35 [running]:
panic(0x95dd80, 0xc08200a0a0)
        C:/Go/src/runtime/panic.go:481 +0x3f4
github.com/ProtonMail/super-secret-project/vendor/github.com/danieljoos/wincred.nativeToCredential(0x0, 0xc08212e000)
        C:/Users/tablet-143/go/src/github.com/ProtonMail/super-secret-project/vendor/github.com/danieljoos/wincred/conver  sion.go:41 +0x4e
github.com/ProtonMail/super-secret-project/vendor/github.com/danieljoos/wincred.nativeCredRead(0xc08210e0f0, 0x27, 0x1, 0  x0, 0x0, 0x0)
        C:/Users/tablet-143/go/src/github.com/ProtonMail/super-secret-project/vendor/github.com/danieljoos/wincred/native  .go:73 +0x2b3
github.com/ProtonMail/super-secret-project/vendor/github.com/danieljoos/wincred.GetGenericCredential(0xc08210e0f0, 0x27,   0xc08210e112, 0x0, 0x0)
        C:/Users/tablet-143/go/src/github.com/ProtonMail/super-secret-project/vendor/github.com/danieljoos/wincred/wincre  d.go:9 +0x4a
github.com/ProtonMail/super-secret-project/vendor/github.com/docker/docker-credential-helpers/wincred.Wincred.Get(0xc0821  0e0f0, 0x27, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
@danieljoos
Copy link
Owner

Looking into it.

@danieljoos
Copy link
Owner

I'm not sure why this happens, but it looks like the CredRead function returned a success state but the credentials pointer is still NULL. I added some checking for null pointers to the conversion routines (1c80202) + some tests (3da991f). This should at least fix the panic and instead returns nil as result.

@emersion
Copy link
Author

emersion commented Aug 8, 2016

It was indeed very strange. It seems to work now. Maybe it was a windows bug fixed in an update.

Anyway, thanks for your fix :)

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

2 participants