Skip to content

Nil pointer dereference #21

@mannaz

Description

@mannaz

In case of unreachable graylog server GraylogHook.gelfLogger is silently initialized to nil: graylog_hook.go#L46 -> graylog_hook.go#L60
Then program crashes with nil pointer dereference on sending entry: graylog_hook.go#L146 -> graylog_hook.go#L208

I believe NewGraylogHook should return error and/or nil *GraylogHook or as a backward-compatible solution *GraylogHook should provide method to get initialization error.

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