pajoye Wed Aug 20 13:27:10 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard php_crypt_r.c
Log:
- strncpy returns the byte copied not error code or 0
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_crypt_r.c?r1=1.1.2.5&r2=1.1.2.6&diff_format=u
Index: php-src/ext/standard/php_crypt_r.c
diff -u php-src/ext/standard/php_crypt_r.c:1.1.2.5
php-src/ext/standard/php_crypt_r.c:1.1.2.6
--- php-src/ext/standard/php_crypt_r.c:1.1.2.5 Sun Aug 10 21:42:48 2008
+++ php-src/ext/standard/php_crypt_r.c Wed Aug 20 13:27:10 2008
@@ -1,4 +1,4 @@
-/* $Id: php_crypt_r.c,v 1.1.2.5 2008/08/10 21:42:48 pajoye Exp $ */
+/* $Id: php_crypt_r.c,v 1.1.2.6 2008/08/20 13:27:10 pajoye Exp $ */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@@ -211,7 +211,7 @@
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) {
+ if (strncpy(passwd + MD5_MAGIC_LEN, sp, sl + 1) < sl) {
goto _destroyCtx1;
}
strcat(passwd, "$");
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php