cloudflare / cloudflare/cfssl

cfssl runtime error: invalid memory address or nil pointer dereference

Open
#1,286 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.5k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I get the following when trying to execute `cfssl version`

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8bf606]

goroutine 1 [running]:
debug/elf.(*Section).ReadAt(0xc00035c180?, {0xc0003fac00?, 0x32?, 0x31?}, 0x31?)
:1 +0x26
archive/zip.readDirectoryEnd({0xbe5040, 0xc00019d500}, 0x5c0)
/usr/lib/go/src/archive/zip/reader.go:581 +0xf5
archive/zip.(*Reader).init(0xc0001d1ab0, {0xbe5040?, 0xc00019d500}, 0x5c0)
/usr/lib/go/src/archive/zip/reader.go:124 +0x5c
archive/zip.NewReader({0xbe5040, 0xc00019d500}, 0x5c0)
/usr/lib/go/src/archive/zip/reader.go:103 +0x5e
github.com/daaku/go%2ezipexe.zipExeReaderElf({0xbe5d80?, 0xc000126088}, 0x11dfb80)
/var/tmp/portage/app-crypt/cfssl-1.4.1/work/cfssl-1.4.1/vendor/github.com/daaku/go.zipexe/zipexe.go:128 +0x8b
github.com/daaku/go%2ezipexe.NewReader({0xbe5d80, 0xc000126088}, 0x0?)
/var/tmp/portage/app-crypt/cfssl-1.4.1/work/cfssl-1.4.1/vendor/github.com/daaku/go.zipexe/zipexe.go:48 +0x98
github.com/daaku/go%2ezipexe.OpenCloser({0xc00012d6f0?, 0xc0001e1be0?})
/var/tmp/portage/app-crypt/cfssl-1.4.1/work/cfssl-1.4.1/vendor/github.com/daaku/go.zipexe/zipexe.go:30 +0x57
github.com/GeertJohan/go%2erice.init.0()
/var/tmp/portage/app-crypt/cfssl-1.4.1/work/cfssl-1.4.1/vendor/github.com/GeertJohan/go.rice/appended.go:41 +0x65

```
During the install of `cfssl 1.4.1` on `Gentoo` I get the following in the output of the install.

```
* QA Notice: Package triggers severe warnings which indicate that it
* may exhibit random runtime failures.
* sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]

```

Linking issue #1062 as I think this is related

Contributor guide

Open the contributing guide

Research direction

Reproduce `cfssl version` in the Gentoo `cfssl-1.4.1` environment, then inspect `vendor/github.com/daaku/go.zipexe/zipexe.go` and `vendor/github.com/GeertJohan/go.rice/appended.go` at the stack frames. Compare the behavior with issue #1062 and determine whether the sqlite3-binding warning is related. Done means the command no longer panics during initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.