Skip to content

Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes #6648

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

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jan 28, 2021

We remove the arbitrary restriction to INT_MAX; it is superfluous on
32bit systems where ZEND_LONG_MAX == INT_MAX anyway, and not useful
on 64bit systems, where larger files should be readable, if the
memory_limit is large enough.

We remove the arbitrary restriction to `INT_MAX`; it is superfluous on
32bit systems where `ZEND_LONG_MAX == INT_MAX` anyway, and not useful
on 64bit systems, where larger files should be readable, if the
`memory_limit` is large enough.
@cmb69 cmb69 added the Bug label Jan 28, 2021
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

I couldn't find any reason for this limitation to exist, probably a leftover from times before we used size_t consistently for everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants