pajoye                                   Tue, 15 Jun 2010 09:26:22 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=300460

Log:
- Fix #51424, crypt() function hangs after 3rd call

Bug: http://bugs.php.net/51424 (Assigned) crypt() function hangs after 3rd call
      
Changed paths:
    U   php/php-src/trunk/ext/standard/php_crypt_r.c
    U   php/php-src/trunk/ext/standard/var_unserializer.c

Modified: php/php-src/trunk/ext/standard/php_crypt_r.c
===================================================================
--- php/php-src/trunk/ext/standard/php_crypt_r.c        2010-06-15 09:26:06 UTC 
(rev 300459)
+++ php/php-src/trunk/ext/standard/php_crypt_r.c        2010-06-15 09:26:22 UTC 
(rev 300460)
@@ -81,11 +81,13 @@
        tsrm_mutex_lock(php_crypt_extended_init_lock);
 #endif

-       if (initialized) {
-               return;
-       } else {
+       if (!initialized) {
+#ifdef PHP_WIN32
+               InterlockedIncrement(initialized);
+#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR >= 2))
+               __sync_fetch_and_add(&initialized, 1);
+#endif
                _crypt_extended_init();
-               initialized = 1;
        }
 #ifdef ZTS
        tsrm_mutex_unlock(php_crypt_extended_init_lock);

Modified: php/php-src/trunk/ext/standard/var_unserializer.c
===================================================================
--- php/php-src/trunk/ext/standard/var_unserializer.c   2010-06-15 09:26:06 UTC 
(rev 300459)
+++ php/php-src/trunk/ext/standard/var_unserializer.c   2010-06-15 09:26:22 UTC 
(rev 300460)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Wed May 26 09:11:18 2010 */
+/* Generated by re2c 0.13.5 on Mon Jun 14 12:03:55 2010 */
 #line 1 "ext/standard/var_unserializer.re"
 /*
   +----------------------------------------------------------------------+

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to