[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2006-12-20 Thread changelog
changelog   Thu Dec 21 01:31:00 2006 UTC

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.2547r2=1.2548diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.2547 php-src/ChangeLog:1.2548
--- php-src/ChangeLog:1.2547Wed Dec 20 01:31:02 2006
+++ php-src/ChangeLog   Thu Dec 21 01:31:00 2006
@@ -1,3 +1,228 @@
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/standard/string.c:
+  fix potential leak, improve length checks
+
+2006-12-20  Marcus Boerger  [EMAIL PROTECTED]
+
+* ext/spl/spl_directory.c:
+  - Quick hackto make tests pass
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/standard/string.c:
+  do not allocate the return value if it wasn't requested
+
+* ZendEngine2/zend_builtin_functions.c:
+  fix possible leak on failure in get_defined_functions()
+
+* ZendEngine2/zend_API.c:
+  fix leak in zend_disable_class()
+
+* ext/standard/file.c:
+  fix double free on error
+
+2006-12-20  Marcus Boerger  [EMAIL PROTECTED]
+
+* ext/spl/php_spl.c
+  ext/spl/php_spl.h:
+  - More unicode
+
+* ext/spl/tests/spl_autoload_001.phpt:
+  - Add unicode expectations
+
+* ext/spl/tests/spl_autoload_002.phpt:
+  - Fix test name
+
+2006-12-20  Andrei Zmievski  [EMAIL PROTECTED]
+
+* unicode-progress.txt:
+  Update.
+
+2006-12-20  Marcus Boerger  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_alloc.c
+  ZendEngine2/zend_alloc.h:
+  - Make shorter and do not use problematic attribute
+
+* ZendEngine2/zend_alloc.c
+  ZendEngine2/zend_alloc.h:
+  - Compilers mightnot like the zstr return,thus return void*
+
+2006-12-20  Andrei Zmievski  [EMAIL PROTECTED]
+
+* ext/standard/browscap.c:
+  Unicode support in get_browser(). To avoid additional copying/conversion
+  during parsing, the browscap values in the returned array will be of
+  IS_STRING type.
+
+* ZendEngine2/zend_API.c:
+  Check for conversion failure in s and return appropriately.
+
+* ZendEngine2/zend_unicode.c:
+  Fix return value in zval_unicode_to_string_ex().
+
+* ZendEngine2/zend_alloc.c:
+  Fix warning.
+
+2006-12-20  Marcus Boerger  [EMAIL PROTECTED]
+
+* README.UNICODE-UPGRADES:
+  - Mention zend_zstrndup()
+
+* ZendEngine2/zend.h
+  ZendEngine2/zend_alloc.c
+  ZendEngine2/zend_alloc.h:
+  - Implement zend_zstrndup()
+
+2006-12-20  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* ext/filter/logical_filters.c:
+  Fixed zts build
+
+* (PHP_5_2)
+  ext/filter/logical_filters.c:
+  fixed ZTS build
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* (PHP_4_4)
+  ext/session/session.c
+  ext/session/session.c:
+  protect _SESSION, HTTP_SESSION_VARS and GLOBALS
+  maintain an internal reference of _SESSION, so that it won't be possible
+  to destroy it from userspace
+
+* ext/session/session.c:
+  remove register_globals remains
+  maintain an internal reference of _SESSION, so that it won't be possible
+  to destroy it from userspace
+
+2006-12-20  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* ext/filter/logical_filters.c
+  ext/filter/tests/015.phpt
+  ext/filter/tests/033.phpt:
+  MFB: Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc).
+
+* (PHP_5_2)
+  NEWS
+  ext/filter/logical_filters.c
+  ext/filter/tests/015.phpt
+  ext/filter/tests/033.phpt:
+  Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc).
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_operators.h:
+  return NULL right away if invalid length was passed
+
+2006-12-20  Andrei Zmievski  [EMAIL PROTECTED]
+
+* ext/standard/formatted_print.c:
+  Align Unicode and binary versions of formatted printing.
+
+* (PHP_5_2)
+  ZendEngine2/zend_language_scanner.l:
+  More correct patch for b-prefixes.
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* (PHP_5_2)
+  NEWS
+  ZendEngine2/zend_language_parser.y:
+  MFH: fix #39903 (Notice message when executing __halt_compiler() more 
than
+  once)
+
+* ZendEngine2/zend_language_parser.y:
+  fix #39903 (Notice message when executing __halt_compiler() more than 
once)
+
+* (PHP_5_2)
+  ZendEngine2/zend_builtin_functions.c:
+  use Z_* macros
+
+* ext/pspell/pspell.c:
+  don't reinvent the wheel, use sprintf()
+
+2006-12-20  Derick Rethans  [EMAIL PROTECTED]
+
+* (PHP_5_2)
+  NEWS
+  ext/filter/logical_filters.c:
+  - Fixed the validate email filter so that the letter v can also be used
+  in
+the user part of the email address. (Derick)
+
+* ext/filter/logical_filters.c:
+  - Fixed the regexp so that the letter v also works.
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/curl/streams.c:
+  gracefully bail out on invalid 

[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog

2006-12-20 Thread changelog
changelog   Thu Dec 21 01:31:03 2006 UTC

  Modified files:  
/ZendEngine2ChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/ChangeLog?r1=1.1039r2=1.1040diff_format=u
Index: ZendEngine2/ChangeLog
diff -u ZendEngine2/ChangeLog:1.1039 ZendEngine2/ChangeLog:1.1040
--- ZendEngine2/ChangeLog:1.1039Wed Dec 20 01:31:04 2006
+++ ZendEngine2/ChangeLog   Thu Dec 21 01:31:02 2006
@@ -1,3 +1,99 @@
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* zend_builtin_functions.c:
+  fix possible leak on failure in get_defined_functions()
+
+* zend_API.c:
+  fix leak in zend_disable_class()
+
+2006-12-20  Marcus Boerger  [EMAIL PROTECTED]
+
+* zend_alloc.c
+  zend_alloc.h:
+  - Make shorter and do not use problematic attribute
+
+* zend_alloc.c
+  zend_alloc.h:
+  - Compilers mightnot like the zstr return,thus return void*
+
+2006-12-20  Andrei Zmievski  [EMAIL PROTECTED]
+
+* zend_API.c:
+  Check for conversion failure in s and return appropriately.
+
+* zend_unicode.c:
+  Fix return value in zval_unicode_to_string_ex().
+
+* zend_alloc.c:
+  Fix warning.
+
+2006-12-20  Marcus Boerger  [EMAIL PROTECTED]
+
+* zend.h
+  zend_alloc.c
+  zend_alloc.h:
+  - Implement zend_zstrndup()
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* zend_operators.h:
+  return NULL right away if invalid length was passed
+
+2006-12-20  Andrei Zmievski  [EMAIL PROTECTED]
+
+* (PHP_5_2)
+  zend_language_scanner.l:
+  More correct patch for b-prefixes.
+
+2006-12-20  Antony Dovgal  [EMAIL PROTECTED]
+
+* (PHP_5_2)
+  zend_language_parser.y:
+  MFH: fix #39903 (Notice message when executing __halt_compiler() more 
than
+  once)
+
+* zend_language_parser.y:
+  fix #39903 (Notice message when executing __halt_compiler() more than 
once)
+
+* (PHP_5_2)
+  zend_builtin_functions.c:
+  use Z_* macros
+
+2006-12-20  Dmitry Stogov  [EMAIL PROTECTED]
+
+* Zend.m4
+  zend_alloc.c:
+  Make MEMORY_LIMIT and ZEND_USE_MALLOC_MM to be always enabled. They don't
+  make a
+  ny significant slowdown, but incrise maintainability a lot. Note that the
+  setting of memory_limit wasn't changes (neither in main/main.c nor in
+  php.ini) and it
+  still set to 16M.
+
+* (PHP_5_2)
+  Zend.m4
+  zend_alloc.c:
+  Make MEMORY_LIMIT and ZEND_USE_MALLOC_MM to be always enabled. They don't
+  make any significant slowdown, but incrise maintainability a lot. Note
+  that the setting of memory_limit wasn't changes (neither in main/main.c
+  nor in php.ini) and it still set to 16M.
+
+2006-12-20  Hannes Magnusson  [EMAIL PROTECTED]
+
+* zend_API.h:
+  MFB:
+  - Fixed incorrect function names on FreeBSD where inet_pton() was named
+  __inet_pton() and inet_ntop() was named __inet_ntop()
+  - Fixed bug #39685 (iconv() - undefined function)
+  - Fixed bug #38852 (XML-RPC Breaks iconv)
+
+* (PHP_5_2)
+  zend_API.h:
+  - Fixed incorrect function names on FreeBSD where inet_pton() was named
+   __inet_pton() and inet_ntop() was named __inet_ntop()
+  - Fixed bug #39685 (iconv() - undefined function)
+  - Fixed bug #38852 (XML-RPC Breaks iconv)
+
 2006-12-19  Marcus Boerger  [EMAIL PROTECTED]
 
 * zend_interfaces.c:
@@ -16154,7 +16250,7 @@
 2003-06-10  Jani Taskinen  [EMAIL PROTECTED]
 
 * zend_multiply.h:
-  - Missing $Id: ChangeLog,v 1.1039 2006/12/20 01:31:04 changelog Exp $ tag
+  - Missing $Id: ChangeLog,v 1.1040 2006/12/21 01:31:02 changelog Exp $ tag
 
 2003-06-10  James Cox  [EMAIL PROTECTED]
 
@@ -17878,7 +17974,7 @@
   zend_types.h
   zend_variables.c
   zend_variables.h:
-  - Added some missing CVS $Id: ChangeLog,v 1.1039 2006/12/20 01:31:04 
changelog Exp $ tags, headers and footers.
+  - Added some missing CVS $Id: ChangeLog,v 1.1040 2006/12/21 01:31:02 
changelog Exp $ tags, headers and footers.
 
 2003-01-30  Ilia Alshanetsky  [EMAIL PROTECTED]
 


[PHP-CVS] cvs: php-src /ext/iconv iconv.c /ext/standard basic_functions.c /main php.h ZendEngine2 zend_API.h

2006-12-20 Thread Hannes Magnusson
bjori   Wed Dec 20 10:38:25 2006 UTC

  Modified files:  
/ZendEngine2zend_API.h 
/php-src/main   php.h 
/php-src/ext/standard   basic_functions.c 
/php-src/ext/iconv  iconv.c 
  Log:
  MFB:
  - Fixed incorrect function names on FreeBSD where inet_pton() was named
  __inet_pton() and inet_ntop() was named __inet_ntop()
  - Fixed bug #39685 (iconv() - undefined function)
  - Fixed bug #38852 (XML-RPC Breaks iconv)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.275r2=1.276diff_format=u
Index: ZendEngine2/zend_API.h
diff -u ZendEngine2/zend_API.h:1.275 ZendEngine2/zend_API.h:1.276
--- ZendEngine2/zend_API.h:1.275Tue Dec 19 21:38:59 2006
+++ ZendEngine2/zend_API.h  Wed Dec 20 10:38:24 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: zend_API.h,v 1.275 2006/12/19 21:38:59 andrei Exp $ */
+/* $Id: zend_API.h,v 1.276 2006/12/20 10:38:24 bjori Exp $ */
 
 #ifndef ZEND_API_H
 #define ZEND_API_H
@@ -48,6 +48,9 @@
 
 #define ZEND_FENTRY(zend_name, name, arg_info, flags)  { #zend_name, name, 
arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags 
},
 
+#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags)   { zend_name, name, 
arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags 
},
+#define ZEND_RAW_NAMED_FE(zend_name, name, arg_info) 
ZEND_RAW_FENTRY(#zend_name, name, arg_info, 0)
+
 #define ZEND_NAMED_FE(zend_name, name, arg_info)   ZEND_FENTRY(zend_name, 
name, arg_info, 0)
 #define ZEND_FE(name, arg_info)
ZEND_FENTRY(name, ZEND_FN(name), arg_info, 0)
 #define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, 
ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
http://cvs.php.net/viewvc.cgi/php-src/main/php.h?r1=1.235r2=1.236diff_format=u
Index: php-src/main/php.h
diff -u php-src/main/php.h:1.235 php-src/main/php.h:1.236
--- php-src/main/php.h:1.235Fri Nov 17 11:41:13 2006
+++ php-src/main/php.h  Wed Dec 20 10:38:24 2006
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php.h,v 1.235 2006/11/17 11:41:13 dmitry Exp $ */
+/* $Id: php.h,v 1.236 2006/12/20 10:38:24 bjori Exp $ */
 
 #ifndef PHP_H
 #define PHP_H
@@ -336,6 +336,7 @@
 #define PHP_FUNCTION   ZEND_FUNCTION
 #define PHP_METHOD ZEND_METHOD
 
+#define PHP_RAW_NAMED_FE ZEND_RAW_NAMED_FE
 #define PHP_NAMED_FE   ZEND_NAMED_FE
 #define PHP_FE ZEND_FE
 #define PHP_DEP_FE  ZEND_DEP_FE
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.841r2=1.842diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.841 
php-src/ext/standard/basic_functions.c:1.842
--- php-src/ext/standard/basic_functions.c:1.841Tue Dec 19 22:01:50 2006
+++ php-src/ext/standard/basic_functions.c  Wed Dec 20 10:38:24 2006
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.841 2006/12/19 22:01:50 andrei Exp $ */
+/* $Id: basic_functions.c,v 1.842 2006/12/20 10:38:24 bjori Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -3378,10 +3378,10 @@
PHP_FE(number_format,   
arginfo_number_format)
PHP_FE(fmod,
arginfo_fmod)
 #ifdef HAVE_INET_NTOP
-   PHP_NAMED_FE(inet_ntop, php_inet_ntop,  
arginfo_inet_ntop)
+   PHP_RAW_NAMED_FE(inet_ntop, php_inet_ntop,  
arginfo_inet_ntop)
 #endif
 #ifdef HAVE_INET_PTON
-   PHP_NAMED_FE(inet_pton, php_inet_pton,  
arginfo_inet_pton)
+   PHP_RAW_NAMED_FE(inet_pton, php_inet_pton,  
arginfo_inet_pton)
 #endif
PHP_FE(ip2long, 
arginfo_ip2long)
PHP_FE(long2ip, 
arginfo_long2ip)
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.147r2=1.148diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.147 php-src/ext/iconv/iconv.c:1.148
--- php-src/ext/iconv/iconv.c:1.147 Wed Nov 15 18:35:18 2006
+++ php-src/ext/iconv/iconv.c   Wed Dec 20 10:38:24 2006
@@ -18,7 +18,7 @@
+--+
  */
 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/curl streams.c

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 13:09:02 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/curl   streams.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/curl/streams.c?r1=1.14.2.2.2.9r2=1.14.2.2.2.10diff_format=u
Index: php-src/ext/curl/streams.c
diff -u php-src/ext/curl/streams.c:1.14.2.2.2.9 
php-src/ext/curl/streams.c:1.14.2.2.2.10
--- php-src/ext/curl/streams.c:1.14.2.2.2.9 Fri Sep 15 15:42:53 2006
+++ php-src/ext/curl/streams.c  Wed Dec 20 13:09:02 2006
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: streams.c,v 1.14.2.2.2.9 2006/09/15 15:42:53 tony2001 Exp $ */
+/* $Id: streams.c,v 1.14.2.2.2.10 2006/12/20 13:09:02 tony2001 Exp $ */
 
 /* This file implements cURL based wrappers.
  * NOTE: If you are implementing your own streams that are intended to
@@ -87,6 +87,11 @@
php_curl_stream *curlstream = (php_curl_stream *) stream-abstract;
TSRMLS_FETCH();
 
+   if (length  2) {
+   /* invalid header ? */
+   return length;
+   }
+
if (!(length == 2  data[0] == '\r'  data[1] == '\n')) {
MAKE_STD_ZVAL(header);
Z_STRLEN_P(header) = length;

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/filter logical_filters.c

2006-12-20 Thread Derick Rethans
derick  Wed Dec 20 14:39:02 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/filter logical_filters.c 
  Log:
  - Fixed the validate email filter so that the letter v can also be used in
the user part of the email address. (Derick)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.445r2=1.2027.2.547.2.446diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.445 php-src/NEWS:1.2027.2.547.2.446
--- php-src/NEWS:1.2027.2.547.2.445 Wed Dec 20 10:49:32 2006
+++ php-src/NEWSWed Dec 20 14:39:01 2006
@@ -10,7 +10,9 @@
   . canary protection (debug build only)
   . random generation of cookies and canaries
 - Fixed incorrect function names on FreeBSD where inet_pton() was named
-  __inet_pton() and inet_ntop() was named __inet_ntop() (Hannes)
+  __inet_pton() and inet_ntop() was named __inet_ntop(). (Hannes)
+- Fixed the validate email filter so that the letter v can also be used in
+  the user part of the email address. (Derick)
 
 - Fixed bug #39869 (safe_read does not initialize errno).
   (michiel at boland dot org, Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.14r2=1.1.2.15diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.14 
php-src/ext/filter/logical_filters.c:1.1.2.15
--- php-src/ext/filter/logical_filters.c:1.1.2.14   Mon Dec 18 14:56:40 2006
+++ php-src/ext/filter/logical_filters.cWed Dec 20 14:39:01 2006
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.14 2006/12/18 14:56:40 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.15 2006/12/20 14:39:01 derick Exp $ */
 
 #include php_filter.h
 #include filter_private.h
@@ -501,7 +501,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From 
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
-   const char regexp[] = 
/^((\\\[^\f\\n\\r\\t\\v\\b]+\\\)|([\\w\\!\\#\\$\\%'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/;
+   const char regexp[] = 
/^((\\\[^\f\\n\\r\\t\\b]+\\\)|([\\w\\!\\#\\$\\%'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/;
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;

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



[PHP-CVS] cvs: php-src /ext/session session.c

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 19:20:59 2006 UTC

  Modified files:  
/php-src/ext/sessionsession.c 
  Log:
  remove register_globals remains
  maintain an internal reference of _SESSION, so that it won't be possible to 
destroy it from userspace
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.457r2=1.458diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.457 php-src/ext/session/session.c:1.458
--- php-src/ext/session/session.c:1.457 Mon Dec  4 15:58:35 2006
+++ php-src/ext/session/session.c   Wed Dec 20 19:20:59 2006
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.457 2006/12/04 15:58:35 tony2001 Exp $ */
+/* $Id: session.c,v 1.458 2006/12/20 19:20:59 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -493,14 +493,17 @@
zval *session_vars = NULL;

/* Unconditionally destroy existing arrays -- possible dirty data */
-   zend_delete_global_variable(HTTP_SESSION_VARS, 
sizeof(HTTP_SESSION_VARS)-1 TSRMLS_CC);
zend_delete_global_variable(_SESSION, sizeof(_SESSION)-1 TSRMLS_CC);
 
+   if (PS(http_session_vars)) {
+   zval_ptr_dtor(PS(http_session_vars));
+   }
+
MAKE_STD_ZVAL(session_vars);
array_init(session_vars);
PS(http_session_vars) = session_vars;

-   ZEND_SET_GLOBAL_VAR_WITH_LENGTH(_SESSION, sizeof(_SESSION), 
PS(http_session_vars), 1, 0);
+   ZEND_SET_GLOBAL_VAR_WITH_LENGTH(_SESSION, sizeof(_SESSION), 
PS(http_session_vars), 2, 1);
 }
 
 static char *php_session_encode(int *newlen TSRMLS_DC)
@@ -729,39 +732,6 @@
}
 }
 
-static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC)
-{
-   zstr str;
-   uint str_len;
-   ulong num_key;
-   int n;
-   zval **val;
-   int ret = 0;
-   
-   n = zend_hash_get_current_key_ex(ht, str, str_len, num_key, 0, pos);
-
-   switch (n) {
-   case HASH_KEY_IS_STRING:
-   case HASH_KEY_IS_UNICODE:
-   if (zend_u_hash_find(EG(symbol_table), n, str, 
str_len, 
-   (void **) val) == SUCCESS 
-val  Z_TYPE_PP(val) != IS_NULL) {
-   /* FIXME: Unicode support??? */
-   ZEND_SET_SYMBOL_WITH_LENGTH(ht, str.s, str_len, 
*val, 
-   (*val)-refcount + 1 , 1);
-   ret = 1;
-   }
-   break;
-   case HASH_KEY_IS_LONG:
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, The session 
bug compatibility code will not 
-   try to locate the global variable $%lu 
due to its 
-   numeric nature, num_key);
-   break;
-   }
-   
-   return ret;
-}
-
 static void php_session_save_current_state(TSRMLS_D)
 {
int ret = FAILURE;
@@ -1507,8 +1477,7 @@
} else {
convert_to_string_ex(entry);
 
-   if ((strcmp(Z_STRVAL_PP(entry), HTTP_SESSION_VARS) != 0) 
-  (strcmp(Z_STRVAL_PP(entry), _SESSION) != 0)) {
+   if (strcmp(Z_STRVAL_PP(entry), _SESSION) != 0) {
PS_ADD_VARL(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry));
}
}
@@ -1617,6 +1586,10 @@
 
 static void php_rshutdown_session_globals(TSRMLS_D)
 {
+   if (PS(http_session_vars)) {
+   zval_ptr_dtor(PS(http_session_vars));
+   PS(http_session_vars) = NULL;
+   }
if (PS(mod_data)) {
zend_try {
PS(mod)-s_close(PS(mod_data) TSRMLS_CC);

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



[PHP-CVS] cvs: php-src /ext/filter logical_filters.c /ext/filter/tests 015.phpt 033.phpt

2006-12-20 Thread Ilia Alshanetsky
iliaa   Wed Dec 20 19:20:22 2006 UTC

  Modified files:  
/php-src/ext/filter logical_filters.c 
/php-src/ext/filter/tests   015.phpt 033.phpt 
  Log:
  MFB: Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.19r2=1.20diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.19 
php-src/ext/filter/logical_filters.c:1.20
--- php-src/ext/filter/logical_filters.c:1.19   Wed Dec 20 14:37:24 2006
+++ php-src/ext/filter/logical_filters.cWed Dec 20 19:20:22 2006
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.19 2006/12/20 14:37:24 derick Exp $ */
+/* $Id: logical_filters.c,v 1.20 2006/12/20 19:20:22 iliaa Exp $ */
 
 #include php_filter.h
 #include filter_private.h
@@ -481,6 +481,13 @@
 void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
php_url *url;
+   int old_len = Z_STRLEN_P(value);
+   
+   php_filter_url(value, flags, option_array, charset TSRMLS_DC);
+
+   if (Z_TYPE_P(value) != IS_STRING || old_len != Z_STRLEN_P(value)) {
+   RETURN_VALIDATION_FAILED
+   }
 
/* Use parse_url - if it returns false, we return NULL */
url = php_url_parse_ex(Z_STRVAL_P(value), Z_STRLEN_P(value));
@@ -490,10 +497,10 @@
}
 
if (
-   ((flags  FILTER_FLAG_SCHEME_REQUIRED)  url-scheme == NULL) 
||
-   ((flags  FILTER_FLAG_HOST_REQUIRED)  url-host == NULL) ||
-   ((flags  FILTER_FLAG_PATH_REQUIRED)  url-path == NULL) ||
-   ((flags  FILTER_FLAG_QUERY_REQUIRED)  url-query == NULL)
+   url-scheme == NULL || 
+   /* some schemas allow the host to be empty */
+   (url-host == NULL  (strcmp(url-scheme, mailto)  
strcmp(url-scheme, news)  strcmp(url-scheme, file))) ||
+   ((flags  FILTER_FLAG_PATH_REQUIRED)  url-path == NULL) || 
((flags  FILTER_FLAG_QUERY_REQUIRED)  url-query == NULL)
) {
php_url_free(url);
RETURN_VALIDATION_FAILED
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/015.phpt?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/filter/tests/015.phpt
diff -u php-src/ext/filter/tests/015.phpt:1.8 
php-src/ext/filter/tests/015.phpt:1.9
--- php-src/ext/filter/tests/015.phpt:1.8   Tue Dec 19 14:16:07 2006
+++ php-src/ext/filter/tests/015.phpt   Wed Dec 20 19:20:22 2006
@@ -24,6 +24,10 @@
 '',
 -1,
 array(),   
+'mailto:[EMAIL PROTECTED]',
+'news:news.php.net',
+'file://foo/bar',
+http://\r\n/bar;,
 );
 foreach ($values as $value) {
var_dump(filter_var($value, FILTER_VALIDATE_URL));
@@ -48,18 +52,22 @@
 string(31) http://www.example/img/test.png;
 string(27) http://www.example/img/dir/;
 string(26) http://www.example/img/dir;
-string(28) http//www.example/wrong/url/
-string(17) http:/www.example
+bool(false)
+bool(false)
 string(18) file:///tmp/test.c
 string(26) ftp://ftp.example.com/tmp/;
-string(11) /tmp/test.c
-string(1) /
 bool(false)
-string(6) http:/
-string(5) http:
-string(4) http
-string(0) 
-string(2) -1
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(18) mailto:[EMAIL PROTECTED]
+string(17) news:news.php.net;
+string(14) file://foo/bar
 bool(false)
 bool(false)
 string(10) http://qwe;
@@ -70,4 +78,4 @@
 string(42) http://www.example.com/path/at/the/server/;
 bool(false)
 string(40) http://www.example.com/index.php?a=bc=d;
-Done
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/033.phpt?r1=1.7r2=1.8diff_format=u
Index: php-src/ext/filter/tests/033.phpt
diff -u php-src/ext/filter/tests/033.phpt:1.7 
php-src/ext/filter/tests/033.phpt:1.8
--- php-src/ext/filter/tests/033.phpt:1.7   Tue Dec 19 14:16:08 2006
+++ php-src/ext/filter/tests/033.phpt   Wed Dec 20 19:20:22 2006
@@ -11,7 +11,7 @@
 boolean  1 

 float1   123   

 validate_regexp
   O'Henry  
-validate_urlPHP  1  [EMAIL PROTECTED]http://a.b.c1.2.3.4   
123  123abc()  O'Henry하퍼
+validate_url   http://a.b.c

 validate_email  [EMAIL PROTECTED]  
  
 validate_ip1.2.3.4 

 string  PHP  1  [EMAIL PROTECTED]

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/filter logical_filters.c /ext/filter/tests 015.phpt 033.phpt

2006-12-20 Thread Ilia Alshanetsky
iliaa   Wed Dec 20 19:20:01 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/filter logical_filters.c 
/php-src/ext/filter/tests   015.phpt 033.phpt 
/php-srcNEWS 
  Log:
  Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.15r2=1.1.2.16diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.15 
php-src/ext/filter/logical_filters.c:1.1.2.16
--- php-src/ext/filter/logical_filters.c:1.1.2.15   Wed Dec 20 14:39:01 2006
+++ php-src/ext/filter/logical_filters.cWed Dec 20 19:20:01 2006
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.15 2006/12/20 14:39:01 derick Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.16 2006/12/20 19:20:01 iliaa Exp $ */
 
 #include php_filter.h
 #include filter_private.h
@@ -477,6 +477,13 @@
 void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
php_url *url;
+   int old_len = Z_STRLEN_P(value);
+   
+   php_filter_url(value, flags, option_array, charset TSRMLS_DC);
+
+   if (Z_TYPE_P(value) != IS_STRING || old_len != Z_STRLEN_P(value)) {
+   RETURN_VALIDATION_FAILED
+   }
 
/* Use parse_url - if it returns false, we return NULL */
url = php_url_parse_ex(Z_STRVAL_P(value), Z_STRLEN_P(value));
@@ -486,10 +493,10 @@
}
 
if (
-   ((flags  FILTER_FLAG_SCHEME_REQUIRED)  url-scheme == NULL) 
||
-   ((flags  FILTER_FLAG_HOST_REQUIRED)  url-host == NULL) ||
-   ((flags  FILTER_FLAG_PATH_REQUIRED)  url-path == NULL) ||
-   ((flags  FILTER_FLAG_QUERY_REQUIRED)  url-query == NULL)
+   url-scheme == NULL || 
+   /* some schemas allow the host to be empty */
+   (url-host == NULL  (strcmp(url-scheme, mailto)  
strcmp(url-scheme, news)  strcmp(url-scheme, file))) ||
+   ((flags  FILTER_FLAG_PATH_REQUIRED)  url-path == NULL) || 
((flags  FILTER_FLAG_QUERY_REQUIRED)  url-query == NULL)
) {
php_url_free(url);
RETURN_VALIDATION_FAILED
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/015.phpt?r1=1.4.2.4r2=1.4.2.5diff_format=u
Index: php-src/ext/filter/tests/015.phpt
diff -u php-src/ext/filter/tests/015.phpt:1.4.2.4 
php-src/ext/filter/tests/015.phpt:1.4.2.5
--- php-src/ext/filter/tests/015.phpt:1.4.2.4   Tue Dec 19 14:16:23 2006
+++ php-src/ext/filter/tests/015.phpt   Wed Dec 20 19:20:01 2006
@@ -24,6 +24,10 @@
 '',
 -1,
 array(),   
+'mailto:[EMAIL PROTECTED]',
+'news:news.php.net',
+'file://foo/bar',
+http://\r\n/bar;,
 );
 foreach ($values as $value) {
var_dump(filter_var($value, FILTER_VALIDATE_URL));
@@ -48,18 +52,22 @@
 string(31) http://www.example/img/test.png;
 string(27) http://www.example/img/dir/;
 string(26) http://www.example/img/dir;
-string(28) http//www.example/wrong/url/
-string(17) http:/www.example
+bool(false)
+bool(false)
 string(18) file:///tmp/test.c
 string(26) ftp://ftp.example.com/tmp/;
-string(11) /tmp/test.c
-string(1) /
 bool(false)
-string(6) http:/
-string(5) http:
-string(4) http
-string(0) 
-string(2) -1
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(18) mailto:[EMAIL PROTECTED]
+string(17) news:news.php.net;
+string(14) file://foo/bar
 bool(false)
 bool(false)
 string(10) http://qwe;
@@ -70,4 +78,4 @@
 string(42) http://www.example.com/path/at/the/server/;
 bool(false)
 string(40) http://www.example.com/index.php?a=bc=d;
-Done
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/033.phpt?r1=1.3.2.4r2=1.3.2.5diff_format=u
Index: php-src/ext/filter/tests/033.phpt
diff -u php-src/ext/filter/tests/033.phpt:1.3.2.4 
php-src/ext/filter/tests/033.phpt:1.3.2.5
--- php-src/ext/filter/tests/033.phpt:1.3.2.4   Tue Dec 19 14:16:23 2006
+++ php-src/ext/filter/tests/033.phpt   Wed Dec 20 19:20:01 2006
@@ -11,7 +11,7 @@
 boolean  1 

 float1   123   

 validate_regexp
   O'Henry  
-validate_urlPHP  1  [EMAIL PROTECTED]http://a.b.c1.2.3.4   
123  123abc()  O'Henry하퍼
+validate_url   http://a.b.c

 validate_email  [EMAIL PROTECTED]  
  
 validate_ip1.2.3.4 
   

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/session session.c

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 19:31:28 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sessionsession.c 
  Log:
  protect _SESSION, HTTP_SESSION_VARS and GLOBALS
  maintain an internal reference of _SESSION, so that it won't be possible to 
destroy it from userspace
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.417.2.8.2.20r2=1.417.2.8.2.21diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.417.2.8.2.20 
php-src/ext/session/session.c:1.417.2.8.2.21
--- php-src/ext/session/session.c:1.417.2.8.2.20Mon Dec  4 15:58:48 2006
+++ php-src/ext/session/session.c   Wed Dec 20 19:31:28 2006
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.417.2.8.2.20 2006/12/04 15:58:48 tony2001 Exp $ */
+/* $Id: session.c,v 1.417.2.8.2.21 2006/12/20 19:31:28 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -465,6 +465,8 @@
int namelen;
int has_value;
php_unserialize_data_t var_hash;
+   int globals_on = PG(register_globals);
+   int longarrays_on = PG(register_long_arrays);
 
PHP_VAR_UNSERIALIZE_INIT(var_hash);
 
@@ -475,15 +477,22 @@
name = estrndup(p + 1, namelen);

p += namelen + 1;
-   
-   if (has_value) {
-   ALLOC_INIT_ZVAL(current);
-   if (php_var_unserialize(current, (const unsigned char 
**) p, (const unsigned char *) endptr, var_hash TSRMLS_CC)) {
-   php_set_session_var(name, namelen, current, 
var_hash  TSRMLS_CC);
+   if (globals_on  namelen == sizeof(_SESSION)-1  
!memcmp(name, _SESSION, sizeof(_SESSION) - 1)) {
+   /* _SESSION hijack attempt */
+   } else if (globals_on  namelen == sizeof(GLOBALS)-1  
!memcmp(name, GLOBALS, sizeof(GLOBALS) - 1)) {
+   /* _GLOBALS hijack attempt */
+   } else if (globals_on  longarrays_on  namelen == 
sizeof(HTTP_SESSION_VARS)-1  !memcmp(name, HTTP_SESSION_VARS, 
sizeof(HTTP_SESSION_VARS)-1)) {
+   /* HTTP_SESSION_VARS hijack attempt */
+   } else {
+   if (has_value) {
+   ALLOC_INIT_ZVAL(current);
+   if (php_var_unserialize(current, (const 
unsigned char **) p, (const unsigned char *) endptr, var_hash TSRMLS_CC)) {
+   php_set_session_var(name, namelen, 
current, var_hash  TSRMLS_CC);
+   }
+   zval_ptr_dtor(current);
}
-   zval_ptr_dtor(current);
+   PS_ADD_VARL(name, namelen);
}
-   PS_ADD_VARL(name, namelen);
efree(name);
}
 
@@ -535,6 +544,8 @@
int namelen;
int has_value;
php_unserialize_data_t var_hash;
+   int globals_on = PG(register_globals);
+   int longarrays_on = PG(register_long_arrays);
 
PHP_VAR_UNSERIALIZE_INIT(var_hash);
 
@@ -556,14 +567,22 @@
name = estrndup(p, namelen);
q++;

-   if (has_value) {
-   ALLOC_INIT_ZVAL(current);
-   if (php_var_unserialize(current, (const unsigned char 
**) q, (const unsigned char *) endptr, var_hash TSRMLS_CC)) {
-   php_set_session_var(name, namelen, current, 
var_hash TSRMLS_CC);
+   if (globals_on  namelen == sizeof(_SESSION)-1  
!memcmp(name, _SESSION, sizeof(_SESSION) - 1)) {
+   /* _SESSION hijack attempt */
+   } else if (globals_on  namelen == sizeof(GLOBALS)-1  
!memcmp(name, GLOBALS, sizeof(GLOBALS) - 1)) {
+   /* GLOBALS hijack attempt */
+   } else if (globals_on  longarrays_on  namelen == 
sizeof(HTTP_SESSION_VARS)-1  !memcmp(name, HTTP_SESSION_VARS, 
sizeof(HTTP_SESSION_VARS)-1)) {
+   /* HTTP_SESSION_VARS hijack attempt */
+   } else {
+   if (has_value) {
+   ALLOC_INIT_ZVAL(current);
+   if (php_var_unserialize(current, (const 
unsigned char **) q, (const unsigned char *) endptr, var_hash TSRMLS_CC)) {
+   php_set_session_var(name, namelen, 
current, var_hash  TSRMLS_CC);
+   }
+   zval_ptr_dtor(current);
}
-   zval_ptr_dtor(current);
+   PS_ADD_VARL(name, namelen);
}
-   PS_ADD_VARL(name, namelen);
efree(name);

p = q;
@@ -583,16 +602,20 @@

[PHP-CVS] cvs: php-src(PHP_4_4) /ext/session session.c

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 19:31:40 2006 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/sessionsession.c 
  Log:
  protect _SESSION, HTTP_SESSION_VARS and GLOBALS
  maintain an internal reference of _SESSION, so that it won't be possible to 
destroy it from userspace
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.336.2.53.2.8r2=1.336.2.53.2.9diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.336.2.53.2.8 
php-src/ext/session/session.c:1.336.2.53.2.9
--- php-src/ext/session/session.c:1.336.2.53.2.8Fri Dec  1 00:28:43 2006
+++ php-src/ext/session/session.c   Wed Dec 20 19:31:40 2006
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.336.2.53.2.8 2006/12/01 00:28:43 iliaa Exp $ */
+/* $Id: session.c,v 1.336.2.53.2.9 2006/12/20 19:31:40 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -418,6 +418,7 @@
int namelen;
int has_value;
php_unserialize_data_t var_hash;
+   int globals_on = PG(register_globals);
 
PHP_VAR_UNSERIALIZE_INIT(var_hash);
 
@@ -428,15 +429,22 @@
name = estrndup(p + 1, namelen);

p += namelen + 1;
-   
-   if (has_value) {
-   ALLOC_INIT_ZVAL(current);
-   if (php_var_unserialize(current, (const unsigned char 
**)p, endptr, var_hash TSRMLS_CC)) {
-   php_set_session_var(name, namelen, current, 
var_hash  TSRMLS_CC);
+   if (globals_on  namelen == sizeof(_SESSION)-1  
!memcmp(name, _SESSION, sizeof(_SESSION) - 1)) {
+   /* _SESSION hijack attempt */
+   } else if (globals_on  namelen == sizeof(GLOBALS)-1  
!memcmp(name, GLOBALS, sizeof(GLOBALS) - 1)) {
+   /* _GLOBALS hijack attempt */
+   } else if (globals_on  namelen == 
sizeof(HTTP_SESSION_VARS)-1  !memcmp(name, HTTP_SESSION_VARS, 
sizeof(HTTP_SESSION_VARS)-1)) {
+   /* HTTP_SESSION_VARS hijack attempt */
+   } else {
+   if (has_value) {
+   ALLOC_INIT_ZVAL(current);
+   if (php_var_unserialize(current, (const 
unsigned char **)p, endptr, var_hash TSRMLS_CC)) {
+   php_set_session_var(name, namelen, 
current, var_hash  TSRMLS_CC);
+   }
+   zval_ptr_dtor(current);
}
-   zval_ptr_dtor(current);
+   PS_ADD_VARL(name, namelen);
}
-   PS_ADD_VARL(name, namelen);
efree(name);
}
 
@@ -488,6 +496,7 @@
int namelen;
int has_value;
php_unserialize_data_t var_hash;
+   int globals_on = PG(register_globals);
 
PHP_VAR_UNSERIALIZE_INIT(var_hash);
 
@@ -509,14 +518,22 @@
name = estrndup(p, namelen);
q++;

-   if (has_value) {
-   ALLOC_INIT_ZVAL(current);
-   if (php_var_unserialize(current, (const unsigned char 
**)q, endptr, var_hash TSRMLS_CC)) {
-   php_set_session_var(name, namelen, current, 
var_hash TSRMLS_CC);
+   if (globals_on  namelen == sizeof(_SESSION)-1  
!memcmp(name, _SESSION, sizeof(_SESSION) - 1)) {
+   /* _SESSION hijack attempt */
+   } else if (globals_on  namelen == sizeof(GLOBALS)-1  
!memcmp(name, GLOBALS, sizeof(GLOBALS) - 1)) {
+   /* _GLOBALS hijack attempt */
+   } else if (globals_on  namelen == 
sizeof(HTTP_SESSION_VARS)-1  !memcmp(name, HTTP_SESSION_VARS, 
sizeof(HTTP_SESSION_VARS)-1)) {
+   /* HTTP_SESSION_VARS hijack attempt */
+   } else { 
+   if (has_value) {
+   ALLOC_INIT_ZVAL(current);
+   if (php_var_unserialize(current, (const 
unsigned char **)q, endptr, var_hash TSRMLS_CC)) {
+   php_set_session_var(name, namelen, 
current, var_hash TSRMLS_CC);
+   }
+   zval_ptr_dtor(current);
}
-   zval_ptr_dtor(current);
+   PS_ADD_VARL(name, namelen);
}
-   PS_ADD_VARL(name, namelen);
efree(name);

p = q;
@@ -536,12 +553,16 @@
zend_hash_del(EG(symbol_table), HTTP_SESSION_VARS, 
sizeof(HTTP_SESSION_VARS));
zend_hash_del(EG(symbol_table), _SESSION, sizeof(_SESSION));
 
+   if (PS(http_session_vars)) {
+   zval_ptr_dtor(PS(http_session_vars));
+   }
+

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/filter logical_filters.c

2006-12-20 Thread Ilia Alshanetsky
iliaa   Wed Dec 20 19:48:12 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/filter logical_filters.c 
  Log:
  fixed ZTS build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.16r2=1.1.2.17diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.16 
php-src/ext/filter/logical_filters.c:1.1.2.17
--- php-src/ext/filter/logical_filters.c:1.1.2.16   Wed Dec 20 19:20:01 2006
+++ php-src/ext/filter/logical_filters.cWed Dec 20 19:48:12 2006
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.16 2006/12/20 19:20:01 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.17 2006/12/20 19:48:12 iliaa Exp $ */
 
 #include php_filter.h
 #include filter_private.h
@@ -479,7 +479,7 @@
php_url *url;
int old_len = Z_STRLEN_P(value);

-   php_filter_url(value, flags, option_array, charset TSRMLS_DC);
+   php_filter_url(value, flags, option_array, charset TSRMLS_CC);
 
if (Z_TYPE_P(value) != IS_STRING || old_len != Z_STRLEN_P(value)) {
RETURN_VALIDATION_FAILED

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



[PHP-CVS] cvs: php-src /ext/standard browscap.c

2006-12-20 Thread Andrei Zmievski
andrei  Wed Dec 20 20:45:40 2006 UTC

  Modified files:  
/php-src/ext/standard   browscap.c 
  Log:
  Unicode support in get_browser(). To avoid additional copying/conversion
  during parsing, the browscap values in the returned array will be of
  IS_STRING type.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/browscap.c?r1=1.88r2=1.89diff_format=u
Index: php-src/ext/standard/browscap.c
diff -u php-src/ext/standard/browscap.c:1.88 
php-src/ext/standard/browscap.c:1.89
--- php-src/ext/standard/browscap.c:1.88Sun Oct  8 13:34:23 2006
+++ php-src/ext/standard/browscap.c Wed Dec 20 20:45:40 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: browscap.c,v 1.88 2006/10/08 13:34:23 bjori Exp $ */
+/* $Id: browscap.c,v 1.89 2006/12/20 20:45:40 andrei Exp $ */
 
 #include php.h
 #include php_regex.h
@@ -277,16 +277,18 @@
 }
 /* }}} */
 
-/* {{{ proto mixed get_browser([string browser_name [, bool return_array]])
+/* {{{ proto mixed get_browser([string browser_name [, bool return_array]]) U
Get information about the capabilities of a browser. If browser_name is 
omitted
or null, HTTP_USER_AGENT is used. Returns an object by default; if 
return_array
is true, returns an array. */
 PHP_FUNCTION(get_browser)
 {
-   zval **agent_name = NULL, **agent, **retarr;
+   char *agent_name = NULL;
+   int agent_name_len;
+   zend_bool return_array = 0;
+   zval **agent;
zval *found_browser_entry, *tmp_copy;
char *lookup_browser_name;
-   zend_bool return_array = 0;
char *browscap = INI_STR(browscap);
 
if (!browscap || !browscap[0]) {
@@ -294,11 +296,12 @@
RETURN_FALSE;
}
 
-   if (ZEND_NUM_ARGS()  2 || zend_get_parameters_ex(ZEND_NUM_ARGS(), 
agent_name, retarr) == FAILURE) {
-   ZEND_WRONG_PARAM_COUNT();
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s!b, 
agent_name,
+ agent_name_len, 
UG(ascii_conv), return_array) == FAILURE) {
+   return;
}
 
-   if (agent_name == NULL || Z_TYPE_PP(agent_name) == IS_NULL) {
+   if (agent_name == NULL) {
zend_is_auto_global(_SERVER, sizeof(_SERVER)-1 TSRMLS_CC);
if (!PG(http_globals)[TRACK_VARS_SERVER]
|| 
zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]-value.ht, 
HTTP_USER_AGENT, sizeof(HTTP_USER_AGENT), (void **) agent_name)==FAILURE) {
@@ -307,16 +310,10 @@
}
}
 
-   convert_to_string_ex(agent_name);
-   lookup_browser_name = estrndup(Z_STRVAL_PP(agent_name), 
Z_STRLEN_PP(agent_name));
-   php_strtolower(lookup_browser_name, strlen(lookup_browser_name));
-
-   if (ZEND_NUM_ARGS() == 2) {
-   convert_to_boolean_ex(retarr);
-   return_array = Z_BVAL_PP(retarr);
-   }
+   lookup_browser_name = estrndup(agent_name, agent_name_len);
+   php_strtolower(lookup_browser_name, agent_name_len);
 
-   if (zend_hash_find(browser_hash, lookup_browser_name, 
strlen(lookup_browser_name)+1, (void **) agent)==FAILURE) {
+   if (zend_hash_find(browser_hash, lookup_browser_name, 
agent_name_len+1, (void **) agent)==FAILURE) {
found_browser_entry = NULL;
zend_hash_apply_with_arguments(browser_hash, 
(apply_func_args_t) browser_reg_compare, 2, lookup_browser_name, 
found_browser_entry);
 
@@ -338,7 +335,7 @@
}
 
while (zend_hash_find(Z_ARRVAL_PP(agent), parent, sizeof(parent), 
(void **) agent_name)==SUCCESS) {
-   if (zend_hash_find(browser_hash, Z_STRVAL_PP(agent_name), 
Z_STRLEN_PP(agent_name)+1, (void **)agent)==FAILURE) {
+   if (zend_hash_find(browser_hash, agent_name, agent_name_len+1, 
(void **)agent)==FAILURE) {
break;
}
 

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



[PHP-CVS] cvs: php-src / unicode-progress.txt

2006-12-20 Thread Andrei Zmievski
andrei  Wed Dec 20 21:02:11 2006 UTC

  Modified files:  
/php-srcunicode-progress.txt 
  Log:
  Update.
  
  
http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.69r2=1.70diff_format=u
Index: php-src/unicode-progress.txt
diff -u php-src/unicode-progress.txt:1.69 php-src/unicode-progress.txt:1.70
--- php-src/unicode-progress.txt:1.69   Tue Dec 19 02:08:16 2006
+++ php-src/unicode-progress.txtWed Dec 20 21:02:11 2006
@@ -11,9 +11,6 @@
 Params API, what encoding to use for the message, handling email
 option
 
-set_include_path(), get_include_path(), restore_include_path()
-Params API, depends on INI mechanism
-
   array.c
   ---
 natsort(), natcasesort()

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



[PHP-CVS] cvs: php-src /ext/spl/tests spl_autoload_001.phpt

2006-12-20 Thread Marcus Boerger
helly   Wed Dec 20 22:08:51 2006 UTC

  Modified files:  
/php-src/ext/spl/tests  spl_autoload_001.phpt 
  Log:
  - Add unicode expectations
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_001.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/spl/tests/spl_autoload_001.phpt
diff -u php-src/ext/spl/tests/spl_autoload_001.phpt:1.5 
php-src/ext/spl/tests/spl_autoload_001.phpt:1.6
--- php-src/ext/spl/tests/spl_autoload_001.phpt:1.5 Wed Dec 21 22:21:54 2005
+++ php-src/ext/spl/tests/spl_autoload_001.phpt Wed Dec 20 22:08:51 2006
@@ -136,3 +136,34 @@
 ===NOFUNCTION===
 Exception: Function 'unavailable_autoload_function' not found
 ===DONE===
+--UEXPECTF--
+===EMPTY===
+unicode(9) .inc,.php
+%stestclass.inc
+Exception: Class TestClass could not be loaded
+===()===
+Exception: Class TestClass could not be loaded
+===(1)===
+Exception: Class TestClass could not be loaded
+===(.inc,,.php.inc)===
+%stestclass
+%stestclass.php.inc
+Exception: Class TestClass could not be loaded
+===()===
+Exception: Class TestClass could not be loaded
+Exception: Class TestClass could not be loaded
+===SPL_AUTOLOAD()===
+unicode(4) .inc
+Exception: Class TestClass could not be loaded
+===REGISTER===
+TestFunc1(TestClass)
+TestFunc2(TestClass)
+bool(false)
+===LOAD===
+TestFunc1(TestClass)
+TestFunc2(TestClass)
+%stestclass.class.inc
+bool(true)
+===NOFUNCTION===
+Exception: Function 'unavailable_autoload_function' not found
+===DONE===

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



[PHP-CVS] cvs: php-src /ext/spl/tests spl_autoload_002.phpt

2006-12-20 Thread Marcus Boerger
helly   Wed Dec 20 22:08:36 2006 UTC

  Modified files:  
/php-src/ext/spl/tests  spl_autoload_002.phpt 
  Log:
  - Fix test name
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_002.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/spl/tests/spl_autoload_002.phpt
diff -u php-src/ext/spl/tests/spl_autoload_002.phpt:1.4 
php-src/ext/spl/tests/spl_autoload_002.phpt:1.5
--- php-src/ext/spl/tests/spl_autoload_002.phpt:1.4 Thu Dec 22 00:20:44 2005
+++ php-src/ext/spl/tests/spl_autoload_002.phpt Wed Dec 20 22:08:35 2006
@@ -1,5 +1,5 @@
 --TEST--
-SPL: spl_autoloadfunctions()
+SPL: spl_autoload_functions()
 --SKIPIF--
 ?php 
if (!extension_loaded(spl)) die(skip);

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



[PHP-CVS] cvs: php-src /ext/spl php_spl.c php_spl.h

2006-12-20 Thread Marcus Boerger
helly   Wed Dec 20 22:11:14 2006 UTC

  Modified files:  
/php-src/ext/splphp_spl.c php_spl.h 
  Log:
  - More unicode
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.103r2=1.104diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.103 php-src/ext/spl/php_spl.c:1.104
--- php-src/ext/spl/php_spl.c:1.103 Tue Dec 19 22:31:26 2006
+++ php-src/ext/spl/php_spl.c   Wed Dec 20 22:11:14 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.103 2006/12/19 22:31:26 helly Exp $ */
+/* $Id: php_spl.c,v 1.104 2006/12/20 22:11:14 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
#include config.h
@@ -55,8 +55,7 @@
  */
 static PHP_GINIT_FUNCTION(spl)
 {
-   spl_globals-autoload_extensions = NULL;
-   spl_globals-autoload_extensions_len = 0;
+   ZVAL_NULL(spl_globals-autoload_extensions);
spl_globals-autoload_functions  = NULL;
spl_globals-autoload_running= 0;
 }
@@ -205,7 +204,7 @@
 }
 /* }}} */
 
-int spl_autoload(const char *class_name, const char * lc_name, int 
class_name_len, const char * file_extension TSRMLS_DC) /* {{{ */
+int spl_autoload(const zstr class_name, const zstr lc_name, int 
class_name_len, const zstr file_extension TSRMLS_DC) /* {{{ */
 {
char *class_file;
int class_file_len;
@@ -216,7 +215,8 @@
zval err_mode;
int ret;
 
-   class_file_len = spprintf(class_file, 0, %s%s, lc_name, 
file_extension);
+   /* UTODO: Wewant the stream toacept a zstrfor opening */
+   class_file_len = spprintf(class_file, 0, %v%v, lc_name, 
file_extension);
 
ZVAL_LONG(err_mode, EG(error_reporting));
if (Z_LVAL(err_mode)) {
@@ -257,48 +257,65 @@
}
 
efree(class_file);
-   return zend_hash_exists(EG(class_table), 
(char*)lc_name, class_name_len+1);
+   return zend_u_hash_exists(EG(class_table), 
ZEND_STR_TYPE, lc_name, class_name_len+1);
}
}
efree(class_file);
return 0;
 } /* }}} */
 
-/* {{{ proto void spl_autoload(string class_name [, string file_extensions])
+/* {{{ proto void spl_autoload(string class_name [, string file_extensions]) U
  Default implementation for __autoload() */
 PHP_FUNCTION(spl_autoload)
 {
-   char *class_name, *lc_name, *file_exts = SPL_G(autoload_extensions);
-   int class_name_len, file_exts_len = SPL_G(autoload_extensions_len), 
found = 0;
-   char *copy, *pos1, *pos2;
+   zstr class_name, lc_name;
+   zstr file_exts = Z_UNIVAL(SPL_G(autoload_extensions));
+   int class_name_len, file_exts_len = 
Z_UNILEN(SPL_G(autoload_extensions)), found = 0;
+   int unicode = UG(unicode);
+   zstr copy, pos1, pos2;
zval **original_return_value = EG(return_value_ptr_ptr);
zend_op **original_opline_ptr = EG(opline_ptr);
zend_op_array *original_active_op_array = EG(active_op_array);
zend_function_state *original_function_state_ptr = 
EG(function_state_ptr);

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|s, 
class_name, class_name_len, file_exts, file_exts_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, x|x, 
class_name, class_name_len, file_exts, file_exts_len) == FAILURE) {
RETURN_FALSE;
}
 
-   copy = pos1 = estrndup(file_exts, file_exts_len);
-   lc_name = zend_str_tolower_dup(class_name, class_name_len);
-   while(pos1  *pos1  !EG(exception)) {
+   copy = pos1 = zend_zstrndup(ZEND_STR_TYPE, file_exts, file_exts_len);
+   lc_name = zend_u_str_tolower_dup(ZEND_STR_TYPE, class_name, 
class_name_len);
+   while(pos1.v  (unicode ? *pos1.u : *pos1.s)  !EG(exception)) {
EG(return_value_ptr_ptr) = original_return_value;
EG(opline_ptr) = original_opline_ptr;
EG(active_op_array) = original_active_op_array;
EG(function_state_ptr) = original_function_state_ptr;
-   pos2 = strchr(pos1, ',');
-   if (pos2) *pos2 = '\0';
+   if (unicode) {
+   pos2.u = u_strchr(pos1.u, ',');
+   if (pos2.u) *pos2.u = '\0';
+   } else {
+   pos2.s = strchr(pos1.s, ',');
+   if (pos2.s) *pos2.s = '\0';
+   }
if (spl_autoload(class_name, lc_name, class_name_len, pos1 
TSRMLS_CC)) {
found = 1;
break; /* loaded */
}
-   pos1 = pos2 ? pos2 + 1 : NULL;
+   if (!pos2.v) {
+   pos1.v = NULL;
+   } else if (unicode) {
+   pos1.u = pos2.u + 1;
+   } else{
+   pos1.s = pos2.s + 1;
+   }
}
-   

[PHP-CVS] cvs: php-src /ext/standard file.c

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 22:42:59 2006 UTC

  Modified files:  
/php-src/ext/standard   file.c 
  Log:
  fix double free on error
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.477r2=1.478diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.477 php-src/ext/standard/file.c:1.478
--- php-src/ext/standard/file.c:1.477   Tue Dec 19 08:59:26 2006
+++ php-src/ext/standard/file.c Wed Dec 20 22:42:59 2006
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.477 2006/12/19 08:59:26 dmitry Exp $ */
+/* $Id: file.c,v 1.478 2006/12/20 22:42:59 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1062,7 +1062,6 @@
fp = VCWD_POPEN(command, posix_mode);
if (!fp) {
php_error_docref2(NULL TSRMLS_CC, command, mode, E_WARNING, 
%s, strerror(errno));
-   efree(posix_mode);
RETVAL_FALSE;
} else {
php_stream *stream = php_stream_fopen_from_pipe(fp, mode);

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



[PHP-CVS] cvs: php-src /ext/standard string.c

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 23:30:11 2006 UTC

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  do not allocate the return value if it wasn't requested
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.624r2=1.625diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.624 php-src/ext/standard/string.c:1.625
--- php-src/ext/standard/string.c:1.624 Tue Dec 19 21:38:59 2006
+++ php-src/ext/standard/string.c   Wed Dec 20 23:30:11 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.624 2006/12/19 21:38:59 andrei Exp $ */
+/* $Id: string.c,v 1.625 2006/12/20 23:30:11 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1679,7 +1679,7 @@
  */
 PHPAPI void php_u_basename(UChar *s, int len, UChar *suffix, int sufflen, 
UChar **p_ret, int *p_len TSRMLS_DC)
 {
-   UChar *ret = NULL, *end, *c, *comp, *cend;
+   UChar *end, *c, *comp, *cend;
int state;
 
c = comp = cend = s;
@@ -1713,10 +1713,9 @@
}
 
len = cend - comp;
-   ret = eustrndup(comp, len);
 
if (p_ret) {
-   *p_ret = ret;
+   *p_ret = eustrndup(comp, len);
}
if (p_len) {
*p_len = len;
@@ -1784,11 +1783,10 @@
}
 
len = cend - comp;
-   ret = emalloc(len + 1);
-   memcpy(ret, comp, len);
-   ret[len] = '\0';
-
if (p_ret) {
+   ret = emalloc(len + 1);
+   memcpy(ret, comp, len);
+   ret[len] = '\0';
*p_ret = ret;
}
if (p_len) {

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



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

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 23:30:30 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   string.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.33r2=1.445.2.14.2.34diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.33 
php-src/ext/standard/string.c:1.445.2.14.2.34
--- php-src/ext/standard/string.c:1.445.2.14.2.33   Mon Dec 18 15:02:16 2006
+++ php-src/ext/standard/string.c   Wed Dec 20 23:30:30 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.33 2006/12/18 15:02:16 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.34 2006/12/20 23:30:30 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1235,11 +1235,11 @@
}
 
len = cend - comp;
-   ret = emalloc(len + 1);
-   memcpy(ret, comp, len);
-   ret[len] = '\0';
 
if (p_ret) {
+   ret = emalloc(len + 1);
+   memcpy(ret, comp, len);
+   ret[len] = '\0';
*p_ret = ret;
}
if (p_len) {

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



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

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 23:36:56 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   string.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.34r2=1.445.2.14.2.35diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.34 
php-src/ext/standard/string.c:1.445.2.14.2.35
--- php-src/ext/standard/string.c:1.445.2.14.2.34   Wed Dec 20 23:30:30 2006
+++ php-src/ext/standard/string.c   Wed Dec 20 23:36:56 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.34 2006/12/20 23:30:30 tony2001 Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.35 2006/12/20 23:36:56 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4045,7 +4045,13 @@
 int php_tag_find(char *tag, int len, char *set) {
char c, *n, *t;
int state=0, done=0;
-   char *norm = emalloc(len+1);
+   char *norm;
+
+   if (len = 0) {
+   return 0;
+   }
+   
+   norm = emalloc(len+1);
 
n = norm;
t = tag;
@@ -4055,9 +4061,6 @@
   and turn any a whatever... into just a and any /tag
   into tag
*/
-   if (!len) {
-   return 0;
-   }
while (!done) {
switch (c) {
case '':

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



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

2006-12-20 Thread Antony Dovgal
tony2001Wed Dec 20 23:37:28 2006 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/standard   string.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.333.2.52.2.6r2=1.333.2.52.2.7diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.52.2.6 
php-src/ext/standard/string.c:1.333.2.52.2.7
--- php-src/ext/standard/string.c:1.333.2.52.2.6Thu Aug 10 17:27:12 2006
+++ php-src/ext/standard/string.c   Wed Dec 20 23:37:27 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.333.2.52.2.6 2006/08/10 17:27:12 iliaa Exp $ */
+/* $Id: string.c,v 1.333.2.52.2.7 2006/12/20 23:37:27 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3224,7 +3224,13 @@
 int php_tag_find(char *tag, int len, char *set) {
char c, *n, *t;
int state=0, done=0;
-   char *norm = emalloc(len+1);
+   char *norm;
+
+   if (len = 0) {
+   return 0;
+   }
+   
+   norm = emalloc(len+1);
 
n = norm;
t = tag;
@@ -3234,9 +3240,6 @@
   and turn any a whatever... into just a and any /tag
   into tag
*/
-   if (!len) {
-   return 0;
-   }
while (!done) {
switch (c) {
case '':

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



[PHP-CVS] cvs: php-src /ext/standard file.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 00:00:11 2006 UTC

  Modified files:  
/php-src/ext/standard   file.c 
  Log:
  fix double free
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.478r2=1.479diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.478 php-src/ext/standard/file.c:1.479
--- php-src/ext/standard/file.c:1.478   Wed Dec 20 22:42:59 2006
+++ php-src/ext/standard/file.c Thu Dec 21 00:00:11 2006
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.478 2006/12/20 22:42:59 tony2001 Exp $ */
+/* $Id: file.c,v 1.479 2006/12/21 00:00:11 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2237,7 +2237,6 @@
/* Types converted, free storage */
efree(delim);
efree(enc);
-   efree(buffer);
} else {
/* Binary stream with binary delimiter/enclosures/prefetch */
php_fgetcsv_ex(stream, delim, delim_len, enc, enc_len, \\, 1, 
buffer, buffer_len, return_value TSRMLS_CC);

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



[PHP-CVS] cvs: php-src /ext/standard datetime.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 00:25:59 2006 UTC

  Modified files:  
/php-src/ext/standard   datetime.c 
  Log:
  bail out if zend_unicode_to_string() fails
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/datetime.c?r1=1.141r2=1.142diff_format=u
Index: php-src/ext/standard/datetime.c
diff -u php-src/ext/standard/datetime.c:1.141 
php-src/ext/standard/datetime.c:1.142
--- php-src/ext/standard/datetime.c:1.141   Thu Dec  7 22:00:55 2006
+++ php-src/ext/standard/datetime.c Thu Dec 21 00:25:58 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: datetime.c,v 1.141 2006/12/07 22:00:55 andrei Exp $ */
+/* $Id: datetime.c,v 1.142 2006/12/21 00:25:58 tony2001 Exp $ */
 
 #include php.h
 #include zend_operators.h
@@ -106,11 +106,16 @@
char *temp;
int temp_len;
 
-   
zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), temp, 
temp_len, ts.u, ts_length TSRMLS_CC);
+   if 
(zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), temp, 
temp_len, ts.u, ts_length TSRMLS_CC) == FAILURE) {
+   RETURN_FALSE;
+   }
ts.s = temp;
ts_length = temp_len;
 
-   
zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), temp, 
temp_len, format.u, format_length TSRMLS_CC);
+   if 
(zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), temp, 
temp_len, format.u, format_length TSRMLS_CC) == FAILURE) {
+   efree(ts.s);
+   RETURN_FALSE;
+   }
format.s = temp;
format_length = temp_len;
}

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



[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cli php_cli.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 00:43:16 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/sapi/cli   php_cli.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.129.2.13.2.10r2=1.129.2.13.2.11diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.129.2.13.2.10 
php-src/sapi/cli/php_cli.c:1.129.2.13.2.11
--- php-src/sapi/cli/php_cli.c:1.129.2.13.2.10  Fri Sep 22 17:41:09 2006
+++ php-src/sapi/cli/php_cli.c  Thu Dec 21 00:43:16 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.129.2.13.2.10 2006/09/22 17:41:09 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.129.2.13.2.11 2006/12/21 00:43:16 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -474,6 +474,12 @@
s_err = php_stream_open_wrapper_ex(php://stderr, wb, 0, NULL, 
sc_err);
 
if (s_in==NULL || s_out==NULL || s_err==NULL) {
+   FREE_ZVAL(zin);
+   FREE_ZVAL(zout);
+   FREE_ZVAL(zerr);
+   if (s_in) php_stream_close(s_in);
+   if (s_out) php_stream_close(s_out);
+   if (s_err) php_stream_close(s_err);
return;
}


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



[PHP-CVS] cvs: php-src(PHP_4_4) /sapi/cli php_cli.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 00:43:30 2006 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/sapi/cli   php_cli.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.51.2.37.2.4r2=1.51.2.37.2.5diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.51.2.37.2.4 
php-src/sapi/cli/php_cli.c:1.51.2.37.2.5
--- php-src/sapi/cli/php_cli.c:1.51.2.37.2.4Thu May 18 20:33:46 2006
+++ php-src/sapi/cli/php_cli.c  Thu Dec 21 00:43:30 2006
@@ -430,6 +430,12 @@
s_err = php_stream_open_wrapper_ex(php://stderr, wb, 0, NULL, 
sc_err);
 
if (s_in==NULL || s_out==NULL || s_err==NULL) {
+   FREE_ZVAL(zin);
+   FREE_ZVAL(zout);
+   FREE_ZVAL(zerr);
+   if (s_in) php_stream_close(s_in);
+   if (s_out) php_stream_close(s_out);
+   if (s_err) php_stream_close(s_err);
return;
}
 

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



[PHP-CVS] cvs: php-src /main/streams memory.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 00:46:51 2006 UTC

  Modified files:  
/php-src/main/streams   memory.c 
  Log:
  fix potential leak
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.26r2=1.27diff_format=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.26 php-src/main/streams/memory.c:1.27
--- php-src/main/streams/memory.c:1.26  Sat Nov  4 20:44:02 2006
+++ php-src/main/streams/memory.c   Thu Dec 21 00:46:51 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: memory.c,v 1.26 2006/11/04 20:44:02 rasmus Exp $ */
+/* $Id: memory.c,v 1.27 2006/12/21 00:46:51 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -688,6 +688,7 @@
ts-mode = mode  mode[0] == 'r' ? TEMP_STREAM_READONLY : 0;
ts-meta = meta;
}
+   efree(comma);
 
return stream;
 }

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 00:47:02 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   memory.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.9r2=1.8.2.6.2.10diff_format=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.8.2.6.2.9 
php-src/main/streams/memory.c:1.8.2.6.2.10
--- php-src/main/streams/memory.c:1.8.2.6.2.9   Sat Nov  4 20:43:28 2006
+++ php-src/main/streams/memory.c   Thu Dec 21 00:47:02 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: memory.c,v 1.8.2.6.2.9 2006/11/04 20:43:28 rasmus Exp $ */
+/* $Id: memory.c,v 1.8.2.6.2.10 2006/12/21 00:47:02 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -688,6 +688,7 @@
ts-mode = mode  mode[0] == 'r' ? TEMP_STREAM_READONLY : 0;
ts-meta = meta;
}
+   efree(comma);
 
return stream;
 }

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/posix posix.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:00:58 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/posix  posix.c 
  Log:
  fix possible leaks
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.70.2.3.2.8r2=1.70.2.3.2.9diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.70.2.3.2.8 
php-src/ext/posix/posix.c:1.70.2.3.2.9
--- php-src/ext/posix/posix.c:1.70.2.3.2.8  Thu Dec  7 01:41:18 2006
+++ php-src/ext/posix/posix.c   Thu Dec 21 01:00:58 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: posix.c,v 1.70.2.3.2.8 2006/12/07 01:41:18 iliaa Exp $ */
+/* $Id: posix.c,v 1.70.2.3.2.9 2006/12/21 01:00:58 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -147,7 +147,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, Revision, $Revision: 1.70.2.3.2.8 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.70.2.3.2.9 $);
php_info_print_table_end();
 }
 /* }}} */
@@ -851,6 +851,7 @@
array_init(return_value);
 
if (!php_posix_group_to_array(g, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix group to array);
RETVAL_FALSE;
}
@@ -869,8 +870,8 @@
int ret;
struct group _g;
struct group *retgrptr;
-   int grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-   char *grbuf = emalloc(grbuflen);
+   int grbuflen;
+   char *grbuf;
 #endif
struct group *g;

@@ -878,6 +879,10 @@
RETURN_FALSE;
}
 #ifdef HAVE_GETGRGID_R
+   
+   grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+   grbuf = emalloc(grbuflen);
+
ret = getgrgid_r(gid, _g, grbuf, grbuflen, retgrptr);
if (ret) {
POSIX_G(last_error) = ret;
@@ -894,6 +899,7 @@
array_init(return_value);
 
if (!php_posix_group_to_array(g, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix group struct to array);
RETVAL_FALSE;
}
@@ -955,6 +961,7 @@
array_init(return_value);
 
if (!php_posix_passwd_to_array(pw, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix passwd struct to array);
RETVAL_FALSE;
}
@@ -972,8 +979,8 @@
 #ifdef HAVE_GETPWUID_R
struct passwd _pw;
struct passwd *retpwptr = NULL;
-   int pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   char *pwbuf = emalloc(pwbuflen);
+   int pwbuflen;
+   char *pwbuf;
int ret;
 #endif
struct passwd *pw;
@@ -982,6 +989,9 @@
RETURN_FALSE;
}
 #ifdef HAVE_GETPWUID_R
+   pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+   pwbuf = emalloc(pwbuflen);
+
ret = getpwuid_r(uid, _pw, pwbuf, pwbuflen, retpwptr);
if (ret) {
POSIX_G(last_error) = ret;
@@ -998,6 +1008,7 @@
array_init(return_value);
 
if (!php_posix_passwd_to_array(pw, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix passwd struct to array);
RETVAL_FALSE;
}
@@ -1115,8 +1126,10 @@
array_init(return_value);
 
for (l=limits; l-name; l++) {
-   if (posix_addlimit(l-limit, l-name, return_value TSRMLS_CC) 
== FAILURE)
+   if (posix_addlimit(l-limit, l-name, return_value TSRMLS_CC) 
== FAILURE) {
+   zval_dtor(return_value);
RETURN_FALSE;
+   }
}
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src /ext/posix posix.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:00:39 2006 UTC

  Modified files:  
/php-src/ext/posix  posix.c 
  Log:
  fix possible leaks
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.82r2=1.83diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.82 php-src/ext/posix/posix.c:1.83
--- php-src/ext/posix/posix.c:1.82  Thu Dec  7 01:41:29 2006
+++ php-src/ext/posix/posix.c   Thu Dec 21 01:00:39 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: posix.c,v 1.82 2006/12/07 01:41:29 iliaa Exp $ */
+/* $Id: posix.c,v 1.83 2006/12/21 01:00:39 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -147,7 +147,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, Revision, $Revision: 1.82 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.83 $);
php_info_print_table_end();
 }
 /* }}} */
@@ -845,6 +845,7 @@
array_init(return_value);
 
if (!php_posix_group_to_array(g, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix group to array);
RETVAL_FALSE;
}
@@ -863,8 +864,8 @@
int ret;
struct group _g;
struct group *retgrptr;
-   int grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-   char *grbuf = emalloc(grbuflen);
+   int grbuflen;
+   char *grbuf;
 #endif
struct group *g;

@@ -872,6 +873,10 @@
RETURN_FALSE;
}
 #ifdef HAVE_GETGRGID_R
+   
+   grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+   grbuf = emalloc(grbuflen);
+
ret = getgrgid_r(gid, _g, grbuf, grbuflen, retgrptr);
if (ret) {
POSIX_G(last_error) = ret;
@@ -888,6 +893,7 @@
array_init(return_value);
 
if (!php_posix_group_to_array(g, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix group struct to array);
RETVAL_FALSE;
}
@@ -949,6 +955,7 @@
array_init(return_value);
 
if (!php_posix_passwd_to_array(pw, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix passwd struct to array);
RETVAL_FALSE;
}
@@ -966,8 +973,8 @@
 #ifdef HAVE_GETPWUID_R
struct passwd _pw;
struct passwd *retpwptr = NULL;
-   int pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   char *pwbuf = emalloc(pwbuflen);
+   int pwbuflen;
+   char *pwbuf;
int ret;
 #endif
struct passwd *pw;
@@ -976,6 +983,9 @@
RETURN_FALSE;
}
 #ifdef HAVE_GETPWUID_R
+   pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+   pwbuf = emalloc(pwbuflen);
+
ret = getpwuid_r(uid, _pw, pwbuf, pwbuflen, retpwptr);
if (ret) {
POSIX_G(last_error) = ret;
@@ -992,6 +1002,7 @@
array_init(return_value);
 
if (!php_posix_passwd_to_array(pw, return_value)) {
+   zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to convert 
posix passwd struct to array);
RETVAL_FALSE;
}
@@ -1109,8 +1120,10 @@
array_init(return_value);
 
for (l=limits; l-name; l++) {
-   if (posix_addlimit(l-limit, l-name, return_value TSRMLS_CC) 
== FAILURE)
+   if (posix_addlimit(l-limit, l-name, return_value TSRMLS_CC) 
== FAILURE) {
+   zval_dtor(return_value);
RETURN_FALSE;
+   }
}
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src(PHP_4_4) /ext/posix posix.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:03:55 2006 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/posix  posix.c 
  Log:
  MFH fix leaks on errors
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.51.2.4.2.1r2=1.51.2.4.2.2diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.51.2.4.2.1 
php-src/ext/posix/posix.c:1.51.2.4.2.2
--- php-src/ext/posix/posix.c:1.51.2.4.2.1  Sun Jan  1 13:46:56 2006
+++ php-src/ext/posix/posix.c   Thu Dec 21 01:03:54 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: posix.c,v 1.51.2.4.2.1 2006/01/01 13:46:56 sniper Exp $ */
+/* $Id: posix.c,v 1.51.2.4.2.2 2006/12/21 01:03:54 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -134,7 +134,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, Revision, $Revision: 1.51.2.4.2.1 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.51.2.4.2.2 $);
php_info_print_table_end();
 }
 /* }}} */
@@ -822,6 +822,7 @@
}
 
if (!php_posix_group_to_array(g, return_value)) {
+   zval_dtor(return_value);
php_error(E_WARNING, %s() unable to convert posix group to 
array,
  get_active_function_name(TSRMLS_C));
RETURN_FALSE;
@@ -853,6 +854,7 @@
}
 
if (!php_posix_group_to_array(g, return_value)) {
+   zval_dtor(return_value);
php_error(E_WARNING, %s() unable to convert posix group struct 
to array,
  get_active_function_name(TSRMLS_C));
RETURN_FALSE;
@@ -898,6 +900,7 @@
}
 
if (!php_posix_passwd_to_array(pw, return_value)) {
+   zval_dtor(return_value);
php_error(E_WARNING, %s() unable to convert posix passwd 
struct to array,
  get_active_function_name(TSRMLS_C));
RETURN_FALSE;
@@ -927,6 +930,7 @@
}
 
if (!php_posix_passwd_to_array(pw, return_value)) {
+   zval_dtor(return_value);
php_error(E_WARNING, %s() unable to convert posix passwd 
struct to array,
  get_active_function_name(TSRMLS_C));
RETURN_FALSE;
@@ -1046,8 +1050,10 @@
}
 
for (l=limits; l-name; l++) {
-   if (posix_addlimit(l-limit, l-name, return_value TSRMLS_CC) 
== FAILURE)
+   if (posix_addlimit(l-limit, l-name, return_value TSRMLS_CC) 
== FAILURE) {
+   zval_dtor(return_value);
RETURN_FALSE;
+   }
}
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src /main/streams xp_socket.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:07:52 2006 UTC

  Modified files:  
/php-src/main/streams   xp_socket.c 
  Log:
  don't leak on error
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.38r2=1.39diff_format=u
Index: php-src/main/streams/xp_socket.c
diff -u php-src/main/streams/xp_socket.c:1.38 
php-src/main/streams/xp_socket.c:1.39
--- php-src/main/streams/xp_socket.c:1.38   Tue Dec 19 08:59:26 2006
+++ php-src/main/streams/xp_socket.cThu Dec 21 01:07:52 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: xp_socket.c,v 1.38 2006/12/19 08:59:26 dmitry Exp $ */
+/* $Id: xp_socket.c,v 1.39 2006/12/21 01:07:52 tony2001 Exp $ */
 
 #include php.h
 #include ext/standard/file.h
@@ -642,6 +642,7 @@
if (xparam-want_errortext) {
spprintf(xparam-outputs.error_text, 0, 
local_addr context option is not a string.);
}
+   efree(host);
return -1;
}
bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), 
Z_STRLEN_PP(tmpzval), bindport, xparam-want_errortext, 
xparam-outputs.error_text TSRMLS_CC);

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams xp_socket.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:08:04 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   xp_socket.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.33.2.2.2.2r2=1.33.2.2.2.3diff_format=u
Index: php-src/main/streams/xp_socket.c
diff -u php-src/main/streams/xp_socket.c:1.33.2.2.2.2 
php-src/main/streams/xp_socket.c:1.33.2.2.2.3
--- php-src/main/streams/xp_socket.c:1.33.2.2.2.2   Tue Dec 19 08:58:58 2006
+++ php-src/main/streams/xp_socket.cThu Dec 21 01:08:04 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: xp_socket.c,v 1.33.2.2.2.2 2006/12/19 08:58:58 dmitry Exp $ */
+/* $Id: xp_socket.c,v 1.33.2.2.2.3 2006/12/21 01:08:04 tony2001 Exp $ */
 
 #include php.h
 #include ext/standard/file.h
@@ -642,6 +642,7 @@
if (xparam-want_errortext) {
spprintf(xparam-outputs.error_text, 0, 
local_addr context option is not a string.);
}
+   efree(host);
return -1;
}
bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), 
Z_STRLEN_PP(tmpzval), bindport, xparam-want_errortext, 
xparam-outputs.error_text TSRMLS_CC);

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/soap php_sdl.c

2006-12-20 Thread Ilia Alshanetsky

Thanks, I've applied the fix.

Ilia

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



[PHP-CVS] cvs: php-src /main/streams memory.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:18:14 2006 UTC

  Modified files:  
/php-src/main/streams   memory.c 
  Log:
  apply correct fix (aka oops!)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.27r2=1.28diff_format=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.27 php-src/main/streams/memory.c:1.28
--- php-src/main/streams/memory.c:1.27  Thu Dec 21 00:46:51 2006
+++ php-src/main/streams/memory.c   Thu Dec 21 01:18:14 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: memory.c,v 1.27 2006/12/21 00:46:51 tony2001 Exp $ */
+/* $Id: memory.c,v 1.28 2006/12/21 01:18:14 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -673,7 +673,6 @@
if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) {
/* store data */
php_stream_temp_write(stream, comma, ilen TSRMLS_CC);
-   efree(comma);
php_stream_temp_seek(stream, 0, SEEK_SET, newoffs TSRMLS_CC);
/* set special stream stuff (enforce exact mode) */
vlen = strlen(mode);

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:18:28 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   memory.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.10r2=1.8.2.6.2.11diff_format=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.8.2.6.2.10 
php-src/main/streams/memory.c:1.8.2.6.2.11
--- php-src/main/streams/memory.c:1.8.2.6.2.10  Thu Dec 21 00:47:02 2006
+++ php-src/main/streams/memory.c   Thu Dec 21 01:18:28 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: memory.c,v 1.8.2.6.2.10 2006/12/21 00:47:02 tony2001 Exp $ */
+/* $Id: memory.c,v 1.8.2.6.2.11 2006/12/21 01:18:28 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -673,7 +673,6 @@
if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) {
/* store data */
php_stream_temp_write(stream, comma, ilen TSRMLS_CC);
-   efree(comma);
php_stream_temp_seek(stream, 0, SEEK_SET, newoffs TSRMLS_CC);
/* set special stream stuff (enforce exact mode) */
vlen = strlen(mode);

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



[PHP-CVS] cvs: php-src /ext/soap php_sdl.c

2006-12-20 Thread Ilia Alshanetsky
iliaa   Thu Dec 21 01:16:36 2006 UTC

  Modified files:  
/php-src/ext/soap   php_sdl.c 
  Log:
  MFB: Optimize out zend_hash_num_elements() call 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.105r2=1.106diff_format=u
Index: php-src/ext/soap/php_sdl.c
diff -u php-src/ext/soap/php_sdl.c:1.105 php-src/ext/soap/php_sdl.c:1.106
--- php-src/ext/soap/php_sdl.c:1.105Wed Sep 20 13:43:04 2006
+++ php-src/ext/soap/php_sdl.c  Thu Dec 21 01:16:36 2006
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_sdl.c,v 1.105 2006/09/20 13:43:04 dmitry Exp $ */
+/* $Id: php_sdl.c,v 1.106 2006/12/21 01:16:36 iliaa Exp $ */
 
 #include php_soap.h
 #include ext/libxml/php_libxml.h
@@ -1862,8 +1862,8 @@
if (i  0) {
sdlTypePtr *tmp;
 
- tmp_elements = emalloc(sizeof(HashTable));
- zend_hash_init(tmp_elements, 0, NULL, NULL, 0);
+   tmp_elements = emalloc(sizeof(HashTable));
+   zend_hash_init(tmp_elements, i, NULL, NULL, 0);
 
zend_hash_internal_pointer_reset(type-elements);
while (zend_hash_get_current_data(type-elements, (void**)tmp) 
== SUCCESS) {

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



[PHP-CVS] cvs: php-src /ext/standard html.c

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:13:50 2006 UTC

  Modified files:  
/php-src/ext/standard   html.c 
  Log:
  fix leak on error
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.119r2=1.120diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.119 php-src/ext/standard/html.c:1.120
--- php-src/ext/standard/html.c:1.119   Wed Nov 22 22:18:46 2006
+++ php-src/ext/standard/html.c Thu Dec 21 01:13:50 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.119 2006/11/22 22:18:46 andrei Exp $ */
+/* $Id: html.c,v 1.120 2006/12/21 01:13:50 tony2001 Exp $ */
 
 /*
  * HTML entity resources:
@@ -955,7 +955,8 @@
 
default:
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, cannot yet handle MBCS!);
-   return 0;
+   efree(ret);
+   return NULL;
}
 
if (php_memnstr(ret, entity, entity_length, 
ret+retlen)) {
@@ -1365,6 +1366,10 @@
 
replaced = php_unescape_html_entities(str.s, str_len, len, 1, 
quote_style, hint_charset TSRMLS_CC);
 
+   if (!replaced) {
+   RETURN_FALSE;
+   }
+
if (type == IS_UNICODE) {
RETVAL_U_STRINGL(UG(utf8_conv), replaced, len, ZSTR_AUTOFREE);
efree(str_utf8);

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



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

2006-12-20 Thread Antony Dovgal
tony2001Thu Dec 21 01:14:30 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   html.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.3r2=1.111.2.2.2.4diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.3 
php-src/ext/standard/html.c:1.111.2.2.2.4
--- php-src/ext/standard/html.c:1.111.2.2.2.3   Wed Nov  1 01:55:11 2006
+++ php-src/ext/standard/html.c Thu Dec 21 01:14:30 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.111.2.2.2.3 2006/11/01 01:55:11 iliaa Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.4 2006/12/21 01:14:30 tony2001 Exp $ */
 
 /*
  * HTML entity resources:
@@ -948,7 +948,8 @@
 
default:
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, cannot yet handle MBCS!);
-   return 0;
+   efree(ret);
+   return NULL;
}
 
if (php_memnstr(ret, entity, entity_length, 
ret+retlen)) {
@@ -1308,7 +1309,10 @@
}
 
replaced = php_unescape_html_entities(str, str_len, len, 1, 
quote_style, hint_charset TSRMLS_CC);
-   RETVAL_STRINGL(replaced, len, 0);
+   if (replaced) {
+   RETURN_STRINGL(replaced, len, 0);
+   }
+   RETURN_FALSE;
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/soap php_sdl.c

2006-12-20 Thread Ilia Alshanetsky
iliaa   Thu Dec 21 01:16:11 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_sdl.c 
  Log:
  Optimize out zend_hash_num_elements() call
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.88.2.12.2.4r2=1.88.2.12.2.5diff_format=u
Index: php-src/ext/soap/php_sdl.c
diff -u php-src/ext/soap/php_sdl.c:1.88.2.12.2.4 
php-src/ext/soap/php_sdl.c:1.88.2.12.2.5
--- php-src/ext/soap/php_sdl.c:1.88.2.12.2.4Thu Nov 30 23:51:24 2006
+++ php-src/ext/soap/php_sdl.c  Thu Dec 21 01:16:10 2006
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_sdl.c,v 1.88.2.12.2.4 2006/11/30 23:51:24 iliaa Exp $ */
+/* $Id: php_sdl.c,v 1.88.2.12.2.5 2006/12/21 01:16:10 iliaa Exp $ */
 
 #include php_soap.h
 #include ext/libxml/php_libxml.h
@@ -1862,8 +1862,8 @@
if (i  0) {
sdlTypePtr *tmp;
 
- tmp_elements = emalloc(sizeof(HashTable));
- zend_hash_init(tmp_elements, zend_hash_num_elements(type-elements), 
NULL, NULL, 0);
+   tmp_elements = emalloc(sizeof(HashTable));
+   zend_hash_init(tmp_elements, i, NULL, NULL, 0);
 
zend_hash_internal_pointer_reset(type-elements);
while (zend_hash_get_current_data(type-elements, (void**)tmp) 
== SUCCESS) {

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



[PHP-CVS] cvs: CVSROOT / avail

2006-12-20 Thread Rasmus Lerdorf
rasmus  Wed Dec 20 16:07:31 2006 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  Karma for zoe
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1225r2=1.1226diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1225 CVSROOT/avail:1.1226
--- CVSROOT/avail:1.1225Tue Dec 19 14:24:48 2006
+++ CVSROOT/avail   Wed Dec 20 16:07:31 2006
@@ -17,7 +17,7 @@
 # The PHP Developers have full access to the full source trees for
 # PHP and PEAR, as well as the documentation.
 
-avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire|phpfi,php3,php-src,pecl,non!
 
-pecl,pear,peardoc,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca
+avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe|phpfi,php3,php-src,pecl!
 
,non-pecl,pear,peardoc,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca
 
 # fastcgi implementation for IIS
 avail|shane,wez,edink|fastcgi-isapi

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