Skip to content

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jul 23, 2015

Due to DIR.offset being declared as short we have an overflow. This patch
changes the field to int.

unsigned int seems to be more logical, but as it was signed before, I didn't want to change that. The change from short to int increases the size of DIR on 32bit systems, but that seems to be neglectable (DIR is a large structure, anyway), so it seems a bitfield is unnecessary.

Anyhow, this patch is an ABI break, and as such is most likely unsuitable for PHP 5.6, unfortunately.

I have not added a regression test, because that would be a very slow test, and I consider it highly unlikely that somebody will revert the field to short in the future.

PS: the bug as well as this patch affects Windows only.

Due to DIR.offset being declared as short we have an overflow. This patch
changes the field to int.
@smalyshev smalyshev added the Bug label Jul 25, 2015
@php-pulls
Copy link

Comment on behalf of cmb at php.net:

Merged into master.

@php-pulls php-pulls closed this Jul 27, 2015
@cmb69 cmb69 deleted the scandir-overflow branch July 27, 2015 23:13
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.

3 participants