php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67512
Patch php-fix-crypt-v1.patch revision 2014-06-25 12:12 UTC by timo dot teras at iki dot fi

Patch php-fix-crypt-v1.patch for *Encryption and hash functions Bug #67512

Patch version 2014-06-25 12:12 UTC

Return to Bug #67512 | Download this patch
Patch Revisions:

Developer: timo.teras@iki.fi

--- php-5.5.13/ext/standard/crypt.c.orig	2014-06-25 13:10:38.930010191 -0300
+++ php-5.5.13/ext/standard/crypt.c	2014-06-25 13:45:09.762124864 -0300
@@ -228,18 +228,20 @@
 		}
 	}
 #else
-
-# if defined(HAVE_CRYPT_R) && (defined(_REENTRANT) || defined(_THREAD_SAFE))
 	{
-#  if defined(CRYPT_R_STRUCT_CRYPT_DATA)
+#  if defined(HAVE_CRYPT_R)
+#    if defined(CRYPT_R_STRUCT_CRYPT_DATA)
 		struct crypt_data buffer;
 		memset(&buffer, 0, sizeof(buffer));
-#  elif defined(CRYPT_R_CRYPTD)
+#    elif defined(CRYPT_R_CRYPTD)
 		CRYPTD buffer;
-#  else
-#    error Data struct used by crypt_r() is unknown. Please report.
-#  endif
+#    else
+#      error Data struct used by crypt_r() is unknown. Please report.
+#    endif
 		crypt_res = crypt_r(password, salt, &buffer);
+#  else
+		crypt_res = crypt(passwrd, salt);
+#endif
 		if (!crypt_res) {
 			return FAILURE;
 		} else {
@@ -247,7 +249,6 @@
 			return SUCCESS;
 		}
 	}
-# endif
 #endif
 }
 /* }}} */
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC