Skip to content

Conversation

@mikomikotaishi
Copy link

@mikomikotaishi mikomikotaishi commented Dec 6, 2025

The previous pdftotext.cc used non-standard features such as VLAs and repeated memcpy() calls. This pull request replaces the VLA and memcpy() calls with direct string construction, and removes the no-op function, replacing it with a lambda. Also, because poppler::document::load_from_raw_data() returns a pointer, it makes sure to free doc by using a smart pointer and uses std::call_once() on poppler::set_debug_error_function() to prevent potential race condition if called by multiple goroutines.

@AD1938 AD1938 requested a review from jerryzhou196 December 13, 2025 03:56
@AD1938 AD1938 self-requested a review December 28, 2025 21:13
Copy link
Member

@AD1938 AD1938 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This will need another team member to review and test before merging. @jerryzhou196

@mikomikotaishi mikomikotaishi changed the title Various code cleanup on pdftotext Address potential leak and various code cleanup on pdftotext Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants