cvs: php-src /ext/standard php_crypt_r.c
| From: | Elizabeth Marie Smith | Date: | Mon, 28 Jul 2008 16:48:38 +0000 |
| Subject: | cvs: php-src /ext/standard php_crypt_r.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-51698@lists.php.net to get a copy of this message | ||
auroraeosrose Mon Jul 28 16:48:38 2008 UTC
Modified files:
/php-src/ext/standard php_crypt_r.c
Log:
Secure versions of string functions don't exist for VC6
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_crypt_r.c?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/php_crypt_r.c
diff -u php-src/ext/standard/php_crypt_r.c:1.1 php-src/ext/standard/php_crypt_r.c:1.2
--- php-src/ext/standard/php_crypt_r.c:1.1 Mon Jul 28 11:34:53 2008
+++ php-src/ext/standard/php_crypt_r.c Mon Jul 28 16:48:38 2008
@@ -1,4 +1,4 @@
-/* $Id: php_crypt_r.c,v 1.1 2008/07/28 11:34:53 pajoye Exp $ */
+/* $Id: php_crypt_r.c,v 1.2 2008/07/28 16:48:38 auroraeosrose Exp $ */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@@ -204,10 +204,18 @@
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
- if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, sp, sl + 1) != 0) {
+#ifdef strncpy_s
+ if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, sp, sl + 1) != 0) {
+ goto _destroyCtx1;
+ }
+ 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) != 0) {
goto _destroyCtx1;
}
- strcat_s(passwd, MD5_HASH_MAX_LEN, "$");
+ strcat(passwd, "$");
+#endif
dwHashLen = 16;