[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] cvs: php-src /ext/standard crypt.c
From:       "Ilia Alshanetsky" <iliaa () php ! net>
Date:       2006-11-30 16:00:05
Message-ID: cvsiliaa1164902405 () cvsserver
[Download RAW message or body]

iliaa		Thu Nov 30 16:00:05 2006 UTC

  Modified files:              
    /php-src/ext/standard	crypt.c 
  Log:
  MFB: Use reantrant crypt_r() whenever possible.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/crypt.c?r1=1.64&r2=1.65&diff_format=u
Index: php-src/ext/standard/crypt.c
diff -u php-src/ext/standard/crypt.c:1.64 php-src/ext/standard/crypt.c:1.65
--- php-src/ext/standard/crypt.c:1.64	Mon Sep 25 01:33:57 2006
+++ php-src/ext/standard/crypt.c	Thu Nov 30 16:00:05 2006
@@ -17,7 +17,7 @@
    |          Rasmus Lerdorf <rasmus@php.net>                             |
    +----------------------------------------------------------------------+
  */
-/* $Id: crypt.c,v 1.64 2006/09/25 01:33:57 pollita Exp $ */
+/* $Id: crypt.c,v 1.65 2006/11/30 16:00:05 iliaa Exp $ */
 #include <stdlib.h>
 
 #include "php.h"
@@ -145,8 +145,15 @@
 		salt[2] = '\0';
 #endif
 	}
-
-	RETVAL_STRING(crypt(str, salt), 1);
+#ifdef HAVE_CRYPT_R
+	{
+		struct crypt_data buffer;
+		memset(&buffer, 0, sizeof(buffer));
+		RETURN_STRING(crypt_r(str, salt, &buffer));
+	}
+#else
+	RETURN_STRING(crypt(str, salt), 1);
+#endif
 }
 /* }}} */
 #endif

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic