[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard php_crypt_r.c

2008-08-20 Thread Pierre-Alain Joye
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.5r2=1.1.2.6diff_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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard php_crypt_r.c

2008-08-10 Thread Pierre-Alain Joye
pajoye  Sun Aug 10 21:34:26 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   php_crypt_r.c 
  Log:
  - MFH: fix the VC6 fix or strncpy_s (md5 crypt failed with VC9 as it used 
strncpy wrongly)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_crypt_r.c?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/php_crypt_r.c
diff -u php-src/ext/standard/php_crypt_r.c:1.1.2.3 
php-src/ext/standard/php_crypt_r.c:1.1.2.4
--- php-src/ext/standard/php_crypt_r.c:1.1.2.3  Mon Jul 28 16:43:51 2008
+++ php-src/ext/standard/php_crypt_r.c  Sun Aug 10 21:34:26 2008
@@ -1,4 +1,4 @@
-/* $Id: php_crypt_r.c,v 1.1.2.3 2008/07/28 16:43:51 auroraeosrose Exp $ */
+/* $Id: php_crypt_r.c,v 1.1.2.4 2008/08/10 21:34:26 pajoye Exp $ */
 /*
+--+
| PHP Version 5|
@@ -203,8 +203,8 @@
}
 
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
-
-#ifdef strncpy_s
+DebugBreak();
+#if _MSC_VER = 1500
if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, 
sp, sl + 1) != 0) {
goto _destroyCtx1;
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard php_crypt_r.c

2008-08-10 Thread Pierre-Alain Joye
pajoye  Sun Aug 10 21:42:48 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   php_crypt_r.c 
  Log:
  - debugbreak may not be desired (harmless in release mode :)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_crypt_r.c?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: php-src/ext/standard/php_crypt_r.c
diff -u php-src/ext/standard/php_crypt_r.c:1.1.2.4 
php-src/ext/standard/php_crypt_r.c:1.1.2.5
--- php-src/ext/standard/php_crypt_r.c:1.1.2.4  Sun Aug 10 21:34:26 2008
+++ php-src/ext/standard/php_crypt_r.c  Sun Aug 10 21:42:48 2008
@@ -1,4 +1,4 @@
-/* $Id: php_crypt_r.c,v 1.1.2.4 2008/08/10 21:34:26 pajoye Exp $ */
+/* $Id: php_crypt_r.c,v 1.1.2.5 2008/08/10 21:42:48 pajoye Exp $ */
 /*
+--+
| PHP Version 5|
@@ -203,7 +203,7 @@
}
 
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
-DebugBreak();
+
 #if _MSC_VER = 1500
if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, 
sp, sl + 1) != 0) {
goto _destroyCtx1;



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard php_crypt_r.c

2008-07-28 Thread Elizabeth Marie Smith
auroraeosrose   Mon Jul 28 16:43:51 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/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.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/php_crypt_r.c
diff -u php-src/ext/standard/php_crypt_r.c:1.1.2.2 
php-src/ext/standard/php_crypt_r.c:1.1.2.3
--- php-src/ext/standard/php_crypt_r.c:1.1.2.2  Mon Jul 28 11:50:34 2008
+++ php-src/ext/standard/php_crypt_r.c  Mon Jul 28 16:43:51 2008
@@ -1,4 +1,4 @@
-/* $Id: php_crypt_r.c,v 1.1.2.2 2008/07/28 11:50:34 pajoye Exp $ */
+/* $Id: php_crypt_r.c,v 1.1.2.3 2008/07/28 16:43:51 auroraeosrose Exp $ */
 /*
+--+
| PHP Version 5|
@@ -204,11 +204,18 @@
 
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
 
+#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(passwd, $);
+#endif
dwHashLen = 16;
 
/* Fetch the ctx hash value */



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