Skip to content

Fix/stream seek negative position - #23907

Open
marc-mabe wants to merge 3 commits into
php:PHP-8.6from
marc-mabe:fix/stream-seek-negative-position
Open

marc-mabe wants to merge 3 commits into
php:PHP-8.6from
marc-mabe:fix/stream-seek-negative-position

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

fixes #23905

This is targeting 8.6 even if this bug exists on 8.4 as well but #21433 conflicts and targets 8.6.
Please tell me if I should target PHP-8.4 instead.

A failed seek reset the internal position to 0 but reported -1 as the
stream position, so ftell() returned false and a following SEEK_CUR
tripped an assertion. Leave the position unchanged instead, like plain
files and php://temp.
A failed seek clamped the internal position but reported -1 as the
stream position, which tripped an assertion on a following SEEK_CUR.
Leave the position unchanged instead.
A failed seek clamped the internal position but reported -1 as the
stream position, which tripped an assertion on a following SEEK_CUR.
Leave the position unchanged instead.
@marc-mabe

Copy link
Copy Markdown
Contributor Author

Ping @iliaal @Girgias @ndossche as you where working/reviewing #21433

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unless I'm missing something, returning -1 is enough without setting *newoffs.
We had a similar issue in zlib before: 2709ebc

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants