Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
poppler
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 613
    • Issues 613
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 39
    • Merge Requests 39
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • poppler
  • poppler
  • Issues
  • #448

Closed
Open
Opened Feb 06, 2018 by Bugzilla Migration User@bugzilla-migration

poppler-glib: poppler_document_new_from_data() receives data as UTF-8 string not binary

Submitted by okimoto

Assigned to poppler-bugs

Link to original bug (#104961)

Description

Created attachment 137181 Add type annotation to poppler_document_new_from_data()

In Poppler-0.18.gir poppler_document_new_from_data() is defined as following:

  <constructor name="new_from_data"
               c:identifier="poppler_document_new_from_data"
               throws="1">
    <doc xml:space="preserve">Creates a new #PopplerDocument.  If %NULL is returned, then @error will be

set. Possible errors include those in the #POPPLER_ERROR and #G_FILE_ERROR domains.</doc> <return-value transfer-ownership="full"> A newly created #PopplerDocument, or %NULL</doc> </return-value> <parameters> <parameter name="data" transfer-ownership="none"> the pdf data contained in a char array</doc> </parameter> <parameter name="length" transfer-ownership="none"> the length of #data</doc> </parameter> password to unlock the file with, or %NULL</doc> </parameter> </parameters> </constructor>

This definition validates data as UTF-8 string when read a PDF data using poppler_document_new_from_data() via gobject-introspection. In general, PDF data is not UTF-8 string. So we should treat parameter data as binary.

I wrote tiny patch and confirm that the poppler_document_new_from_data() definition is updated after applied this patch. However, I'm not familiar with gobject-introspection in honest.

Patch 137181, "Add type annotation to poppler_document_new_from_data()":
add-type-annotation-to-poppler_document_new_from_data.diff

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: poppler/poppler#448