forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Merged
ircmaxell
merged 37 commits into
ircmaxell:string_size_refactor_take_2
from
weltling:string_size_refactor_take_2
Aug 17, 2013
Merged
String size refactor take 2, partial fixes to ext/standard #5
ircmaxell
merged 37 commits into
ircmaxell:string_size_refactor_take_2
from
weltling:string_size_refactor_take_2
Aug 17, 2013
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…using --enable-dtrace) by Sixd
* 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
…nitialized' warnings.
* 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
* 'master' of https://git.php.net/repository/php-src: Fixed #65431 in zend_exception.c by Sixd
* PHP-5.4:
* PHP-5.5:
* 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
pushed a commit
that referenced
this pull request
Apr 18, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.