KEMBAR78
Handle large mime files parsing errors · Issue #8532 · facebook/hhvm · GitHub
Skip to content

Handle large mime files parsing errors  #8532

@madhugb

Description

@madhugb

ProcessLine method returns error when it identifies a mime that contains more than 300 children. MimePart::parse is not handling this error which causes the ProcessLine to log an error for every line of the mime.

This bug was fixed in PECL mailparse-v3.0.3 which was not ported hhvm library.

Bug - https://bugs.php.net/bug.php?id=63542
Fix - php/pecl-mail-mailparse@8aa8c3d

I have tried to simply port these fixes to HHVM.

HHVM Version

$ hhvm --version
HipHop VM 4.0.4 (rel)
Compiler: 1558567803_N
Repo schema: 3db73d7601eff5f54a8e907a42a71f8c7bfae2cb

Operating System and Version

MacOS Mojave 10.14.5

Standalone code, or other way to reproduce the problem

Pass a large email (with more than 300 attachments) to MimePart::parse method.

MimePart::parse(<large file>, <size>)

Actual result

  • Generates lots of MIME message too complex errors.
  • Full parsed MIME resource is not returned.

Expected result

  • Should generate a single MIME message too complex error
  • MimePart::parse should return false

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