pajoye          Wed Aug 20 13:31:30 2008 UTC

  Modified files:              
    /php-src/ext/standard       php_crypt_r.c 
  Log:
  - MFB: 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.3&r2=1.4&diff_format=u
Index: php-src/ext/standard/php_crypt_r.c
diff -u php-src/ext/standard/php_crypt_r.c:1.3 
php-src/ext/standard/php_crypt_r.c:1.4
--- php-src/ext/standard/php_crypt_r.c:1.3      Sun Aug 10 21:34:02 2008
+++ php-src/ext/standard/php_crypt_r.c  Wed Aug 20 13:31:30 2008
@@ -1,4 +1,4 @@
-/* $Id: php_crypt_r.c,v 1.3 2008/08/10 21:34:02 pajoye Exp $ */
+/* $Id: php_crypt_r.c,v 1.4 2008/08/20 13:31:30 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

Reply via email to