Skip to content

String size refactor take 2, partial fixes to ext/standard #5

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

Conversation

weltling
Copy link

Not everything working yet, but many things do. Special emphasis has to be paid to signed/unsigned arithmetic, like substr(). ext/standard is still in progress, but important things work. About size_t and an unsigned type, a small snippet

int i = -11;
unsigned u = 10;

then

(u > i) == 0;
u + i == UINT_MAX

In every operation an unsigned operand will have precedence and the signed one will first be converted to the corresponding unsigned, in case the signed one was negative it'll become nearly the unsigned type max. Working with this needs clear understanding how to do math on signed/unsigned integers. Like in the case of substr(), i've tried to avoid the casts, but later or earlier there's no chance to pass by on those.

weltling and others added 30 commits August 13, 2013 07:59
* PHP-5.3:
  Fix CVE-2013-4073 - handling of certs with null bytes
* PHP-5.4:
  Fix CVE-2013-4073 - handling of certs with null bytes
  Fix CVE-2013-4073 - handling of certs with null bytes
* PHP-5.5:
  Fix CVE-2013-4073 - handling of certs with null bytes
  Fix CVE-2013-4073 - handling of certs with null bytes
Represent the file size as string when the total size would overflow
LONG_MAX. Otherwise while file itself were uploaded, the size would
be shown wrong. This mostly applies to systems with 32 bit long.
* PHP-5.4:
  Skip test if SKIP_ONLINE_TESTS set
* PHP-5.5:
  Skip test if SKIP_ONLINE_TESTS set
* PHP-5.4:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/dba/libinifile/inifile.c
* PHP-5.5:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/gmp/gmp.c
* PHP-5.5:
  Reduce compiler noise by removing unused variables and labels
… PHP-5.4

* 'PHP-5.4' of https://git.php.net/repository/php-src:
  Fixed #65431 in zend_exception.c by Sixd
… PHP-5.5

* 'PHP-5.5' of https://git.php.net/repository/php-src:
  Fixed #65431 in zend_exception.c by Sixd
dsp and others added 7 commits August 15, 2013 22:47
* PHP-5.5:
  New news section
  Prepare news for PHP-5.5.2
…ize_refactor_take_2

Conflicts:
	Zend/zend_exceptions.c
	ext/date/php_date.c
	ext/standard/string.c
	ext/standard/url_scanner_ex.c
	ext/standard/url_scanner_ex.re
	main/rfc1867.c
all the signed/unsigned arithmetic needs clear understanding
ircmaxell added a commit that referenced this pull request Aug 17, 2013
String size refactor take 2, partial fixes to ext/standard
@ircmaxell ircmaxell merged commit dc29937 into ircmaxell:string_size_refactor_take_2 Aug 17, 2013
krakjoe added a commit that referenced this pull request Apr 25, 2014
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.

6 participants