[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ php_crypt_r.c var_unserializer.c

2010-06-15 Thread Pierre Joye
pajoye   Tue, 15 Jun 2010 09:26:22 +

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.c2010-06-15 09:26:06 UTC 
(rev 300459)
+++ php/php-src/trunk/ext/standard/php_crypt_r.c2010-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

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ php_crypt_r.c

2009-11-02 Thread Pierre-Alain Joye
pajoye   Mon, 02 Nov 2009 23:02:16 +

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

Log:
- WS

Changed paths:
U   php/php-src/trunk/ext/standard/php_crypt_r.c

Modified: php/php-src/trunk/ext/standard/php_crypt_r.c
===
--- php/php-src/trunk/ext/standard/php_crypt_r.c2009-11-02 20:46:52 UTC 
(rev 290154)
+++ php/php-src/trunk/ext/standard/php_crypt_r.c2009-11-02 23:02:16 UTC 
(rev 290155)
@@ -205,11 +205,11 @@
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);

 #if _MSC_VER >= 1500
-   if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, 
sp, sl + 1) != 0) {
-   goto _destroyCtx1;
-   }
+   if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, 
sp, sl + 1) != 0) {
+   goto _destroyCtx1;
+   }
passwd[MD5_MAGIC_LEN + sl] = '\0';
-   strcat_s(passwd, MD5_HASH_MAX_LEN, "$");
+   strcat_s(passwd, MD5_HASH_MAX_LEN, "$");
 #else
/* VC6 version doesn't have strcat_s or strncpy_s */
if (strncpy(passwd + MD5_MAGIC_LEN, sp, sl + 1) < sl) {

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