Skip to content

EPDFText_GetCharGeometry crashes with null pointer on malformed PDFs #85

Open

Description

@balazs-szucs

Calling EPDFText_GetCharGeometry on broken or fuzzed PDFs causes a segmentation fault (AddressSanitizer: SEGV).

This happens when a text object in the PDF has text but no font set.

Crash Trace

#0 CPDF_TextState::GetFont() const at cpdf_textstate.cpp:29
#1 GetCharLocalBoxes(...) at cpdf_textpage.cpp:289
#2 CPDF_TextPage::GetCharLocalGeometry(...) at cpdf_textpage.cpp:678
#3 EPDFText_GetCharGeometry(...) at fpdf_text.cpp:396

Due to this in jpdfium_redact.cpp, EPDFText_GetCharGeometry was removed from bridge. Currently, PDF passed with normal /Rect bounding boxes to EmbedPDF redaction instead of character quads. This workaround may yield some reliability issues, so if/when this fixed, evaluate to migrate back.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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