-
Notifications
You must be signed in to change notification settings - Fork 86
Fix memory exhaustion when reading corrupted FPT memo files #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Prevents the memo reader from attempting to allocate excessive memory when encountering corrupted FPT files. Added a safety check to limit the maximum memo length to 100MB per column, preventing fatal memory errors (e.g., attempts to allocate ~1.9GB) during file processing.
Fix CI failing due to an outdated upload-artifact
- Update Code Climate test-reporter download logic to use amancevice/setup-codeclimate action, fixing the 404 error caused by outdated download URLs. - Upgrade actions/upload-artifact and actions/download-artifact from v2 to v4. - Implement unique naming for coverage artifacts (clover and cc) to comply with v4 requirements, where artifact names must be unique per job matrix. - Adjust artifact download paths and glob patterns in upload jobs to match the new v4 directory structure. - Upgrade actions/checkout to v4 for better performance and security.
- Replaced the failing amancevice/setup-codeclimate action with a direct download from the official Code Climate GitHub releases. - Fixed the 404 error by using the stable release URL for the test-reporter binary. - Updated execution commands to use the local path (./cc-test-reporter).
Code Climate has ended support for the test-reporter binary
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
Sorry for spaming with unchecked commits. I'm little still learning how to work with Github. Test are fixed.
|
|
@gam6itko Hello. I encountered a critical issue where corrupted memo files (.fpt) caused the StreamWrapper to attempt reading excessive amounts of data, leading to a fatal memory exhaustion error. When a memo field header is corrupted, the length value can be read as an extremely large integer. The current implementation attempts to allocate memory based on this value without validation. I've implemented a safety guard that throws an Exception if a single memo field exceeds a 100MB threshold. While FoxPro theoretically allows large files, a single memo entry exceeding 100MB is highly atypical for standard DBF use cases and almost certainly indicates file corruption. This limit prevents the PHP process from crashing the entire environment. If 100MB is considered too restrictive for this library, I am open to making this value configurable or adjusting it based on your feedback. |
Prevents the memo reader from attempting to allocate excessive memory when encountering corrupted FPT files.
Added a safety check to limit the maximum memo length to 100MB per column, preventing fatal memory errors (e.g., attempts to allocate ~1.9GB) during file processing.