php-src/ext/standard
Alex Dowad 7a9f0cc3d0 Simplify _crypt_extended_init_r, and fix redundant initialization on Win32/Solaris
Looking at the history of this function, the original implementation had a bug where
it would return from the middle of the function without unlocking the mutex first.
The author attempted to fix this by incrementing the `initialized` flag atomically,
which is not necessary, since the section which modifies the flag is protected by a
mutex.

Coincidentally, at the same time that all this unnecessary 'atomic' machinery was
introduced, the code was also changed so that it didn't return without unlocking the
mutex. So it looks like the bug was fixed by accident.

It's not necessary to declare the flag as `volatile` either, since it is protected
by a mutex.

Further, the 'fixed' implementation was also wrong in another respect: on Windows
and Solaris, the `initialized` flag was not even declared as `static`!! So the
initialization of the static tables for S-boxes, P-boxes, etc. was repeated on
each call to `php_crypt`, completely defeating the purpose of this function.
2020-06-23 16:10:54 +02:00
..
html_tables Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
tests Fix #73529: session_decode() silently fails on wrong input 2020-06-10 16:48:49 +02:00
array.c Add ZVAL_OBJ_COPY macro 2020-06-17 16:36:56 +02:00
assert.c Implement #47074: phpinfo() reports "On" as 1 for the some extensions 2020-06-04 11:25:45 +02:00
base64.c More precise ifunc resolver return type 2020-04-15 11:01:12 +02:00
base64.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
basic_functions_arginfo.h Add tests to check mismatching function signatures 2020-06-06 09:23:34 +02:00
basic_functions.c Fix typos 2020-06-17 16:45:12 +02:00
basic_functions.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
basic_functions.stub.php Add tests to check mismatching function signatures 2020-06-06 09:23:34 +02:00
browscap.c Move extra checks after zpp in get_browser() 2019-11-06 17:50:48 +01:00
config.m4 Simplify _crypt_extended_init_r, and fix redundant initialization on Win32/Solaris 2020-06-23 16:10:54 +02:00
config.w32 Remove convert_cyr_string() function 2019-12-05 13:15:54 +01:00
crc32.c Merge branch 'PHP-7.4' 2020-05-14 09:39:03 +02:00
crc32.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
credits_ext.h Update CREDITS 2020-06-17 13:04:01 +00:00
credits_sapi.h
credits.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
credits.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
crypt_blowfish.c Drop BF_ASM constant as it's always 0 2020-05-06 17:55:32 +02:00
crypt_blowfish.h
crypt_freesec.c Use unsigned char in _crypt_extended_r 2019-06-19 15:09:00 +02:00
crypt_freesec.h Use unsigned char in _crypt_extended_r 2019-06-19 15:09:00 +02:00
crypt_sha256.c
crypt_sha512.c
crypt.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
css.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
css.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
datetime.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
datetime.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
dir_arginfo.h Generate function entries from stubs for a couple of extensions 2020-04-14 11:49:02 +02:00
dir.c Improve a last couple of argument error messages 2020-04-20 13:09:00 +02:00
dir.stub.php Generate function entries from stubs for a couple of extensions 2020-04-14 11:49:02 +02:00
dl_arginfo.h Add stubs for some SAPIs 2020-05-14 13:35:12 +02:00
dl.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
dl.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
dl.stub.php Add stubs for some SAPIs 2020-05-14 13:35:12 +02:00
dns_win32.c Merge branch 'PHP-7.4' 2020-05-04 23:02:00 +02:00
dns.c Merge branch 'PHP-7.4' 2020-05-04 23:02:00 +02:00
exec.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
exec.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
file.c Fix expression warnings and break warnings 2020-06-07 10:41:11 +02:00
file.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
filestat.c Reduce code duplication using for loop 2020-04-27 17:03:40 +02:00
filters.c Merge branch 'PHP-7.4' 2020-06-08 23:28:36 +02:00
flock_compat.c Fix expression warnings and break warnings 2020-06-07 10:41:11 +02:00
flock_compat.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
formatted_print.c Add support for * width and precision in printf() 2020-05-27 10:42:25 +02:00
fsock.c Make error messages more consistent by fixing capitalization 2020-01-17 14:52:46 +01:00
fsock.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
ftok.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
ftp_fopen_wrapper.c Fix format for tm member objects as they are stored as integers 2020-03-30 17:09:49 +02:00
head.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
head.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
hrtime.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
hrtime.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
html_tables.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
html.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
html.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
http_fopen_wrapper.c Merge branch 'PHP-7.4' 2020-02-24 10:20:49 +01:00
http.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
image.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
incomplete_class.c Implemented FR #78638 (__PHP_Incomplete_Class should be final) 2019-12-24 17:09:44 +08:00
info.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
info.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
iptc.c Drop unnecessary stdint and inttypes header checks 2020-04-22 20:18:19 +02:00
lcg.c Convert zend_parse_parameters_none() to fast ZPP in standard lib 2019-12-30 15:28:37 +01:00
levenshtein.c Use RETURN_THROWS() when an exception is thrown 2019-12-30 17:38:10 +01:00
link.c Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
mail.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
Makefile.frag
Makefile.frag.w32
math.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
md5.c Avoid used of "named fn" in ext/standard 2020-02-25 10:21:31 +01:00
md5.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
metaphone.c Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
microtime.c Fix Haiku build 2020-06-19 17:21:55 +02:00
mt_rand.c Improve a last couple of argument error messages 2020-04-20 13:09:00 +02:00
net.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
pack.c Use RETURN_THROWS() after try_convert_to_string() 2020-01-03 17:04:06 +01:00
pack.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
pageinfo.c Convert zend_parse_parameters_none() to fast ZPP in standard lib 2019-12-30 15:28:37 +01:00
pageinfo.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
password.c Fix warning of strict-prototypes 2020-06-07 10:36:50 +02:00
php_array.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_assert.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_browscap.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_crypt_r.c Simplify _crypt_extended_init_r, and fix redundant initialization on Win32/Solaris 2020-06-23 16:10:54 +02:00
php_crypt_r.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_crypt.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_dir.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_dns.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_ext_syslog.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_filestat.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_fopen_wrapper.c Improve argument error messages in ext/standard 2020-03-18 19:56:10 +01:00
php_fopen_wrappers.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_http.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_image.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_incomplete_class.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_lcg.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_mail.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_math.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_mt_rand.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_net.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_password.h Fix warning of strict-prototypes 2020-06-07 10:36:50 +02:00
php_rand.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_random.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_smart_string_public.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_smart_string.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_standard.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_string.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_uuencode.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
php_var.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
php_versioning.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
proc_open.c Implements an openpty wrapper for solaris based systems 2020-06-16 11:19:00 +02:00
proc_open.h Further refactoring of proc_open.c 2020-05-14 10:25:52 +02:00
quot_print.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
quot_print.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
rand.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
random.c Improve argument error messages in ext/standard 2020-03-18 19:56:10 +01:00
scanf.c Promote warnings to exceptions in *scanf() functions 2019-12-10 13:01:59 +01:00
scanf.h Promote warnings to exceptions in *scanf() functions 2019-12-10 13:01:59 +01:00
sha1.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
sha1.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
soundex.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
streamsfuncs.c Improve a last couple of argument error messages 2020-04-20 13:09:00 +02:00
streamsfuncs.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
string.c Clean up some unused code (and fix some comments) in build scripts 2020-06-19 22:04:52 +02:00
strnatcmp.c [ci skip] Remove text editor modelines 2019-03-23 21:09:38 +01:00
syslog.c Revert "Make BG(syslog_device) per request" 2020-01-30 16:18:02 +01:00
type.c Rename zend_zval_get_type() API 2020-05-13 14:56:05 +02:00
uniqid.c Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
url_scanner_ex.h Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
url_scanner_ex.re Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
url.c drop use of extract_epi16 2020-05-09 12:28:49 +08:00
url.h Remove now unnecessary PHP_FUNCTION() declarations 2020-04-03 15:41:41 +02:00
user_filters_arginfo.h Generate function entries from stubs for a couple of extensions 2020-04-14 11:49:02 +02:00
user_filters.c Improve some TypeError and ValueError messages 2020-04-14 14:38:45 +02:00
user_filters.stub.php Generate function entries from stubs for a couple of extensions 2020-04-14 11:49:02 +02:00
uuencode.c Constify char * arguments of APIs 2020-06-08 10:38:45 +02:00
var_unserializer.re Add helper APIs for maybe-interned string creation 2020-06-08 15:31:52 +02:00
var.c Add ZVAL_OBJ_COPY macro 2020-06-17 16:36:56 +02:00
versioning.c Improve argument error messages in ext/standard 2020-03-18 19:56:10 +01:00
winver.h