Skip to content

BUG: Unsafe type assertion without ok check in fetcher #807

@andrinoff

Description

@andrinoff

Describe the bug
Type assertion at fetcher/fetcher.go:883 on p.Header without ok check. Malformed MIME headers cause panic.

To reproduce

  1. Receive email with malformed MIME structure
  2. Type assertion fails
  3. Application panics

Expected behavior
Use type assertion with ok check: h, ok := p.Header.(*mail.InlineHeader)

Matcha version
master

OS
All

Additional context
File: fetcher/fetcher.go line 883
Panic on unexpected header type

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions