Skip to content

crypto.go nil pointer dereference when empty KeyCertConf.RSAPrivateKey is provided #175

@rpieczon

Description

@rpieczon

Returning block could be nil here:

block, _ := pem.Decode(config.Data.KeyCertConf.RSAPrivateKey)

It leads to "Invalid memory address or nil pointer dereference" error.

pem.Decode(...) function documentation:

Decode will find the next PEM formatted block (certificate, private key etc) in the input. It returns that block and the remainder of the input. If no PEM data is found, p is nil and the whole of the input is returned in rest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions