Skip to content

BUG: Unchecked error on ReadAll in decodePart() #750

@andrinoff

Description

@andrinoff

Describe the bug
Unchecked error when reading all data from reader in decodePart() function at fetcher/fetcher.go:138. The result is assigned to _, _ which silently ignores potential read failures.

To reproduce

  1. Trigger decodePart() with failing reader
  2. Error is silently ignored
  3. Partial or corrupt data may be returned

Expected behavior
Should check error and return it to caller

Matcha version
master branch

OS
All

Additional context
File: fetcher/fetcher.go line 138
Pattern: body, _ := ioutil.ReadAll(reader) with ignored error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions