[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/cgi/fastcgi.c trunk/sapi/cgi/fastcgi.c

2011-01-19 Thread Dmitry Stogov
dmitry   Wed, 19 Jan 2011 08:38:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307579

Log:
Added checks for malformated FastCGI requests (Edgar Frank)

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/cgi/fastcgi.c
U   php/php-src/trunk/sapi/cgi/fastcgi.c

Modified: php/php-src/branches/PHP_5_3/sapi/cgi/fastcgi.c
===
--- php/php-src/branches/PHP_5_3/sapi/cgi/fastcgi.c 2011-01-19 07:27:40 UTC 
(rev 307578)
+++ php/php-src/branches/PHP_5_3/sapi/cgi/fastcgi.c 2011-01-19 08:38:25 UTC 
(rev 307579)
@@ -605,28 +605,39 @@
 {
char buf[128];
char *tmp = buf;
-   int buf_size = sizeof(buf);
-   int name_len, val_len;
+   size_t buf_size = sizeof(buf);
+   unsigned int name_len, val_len;
char *s;
int ret = 1;

while (p  end) {
name_len = *p++;
if (name_len = 128) {
+   if (p + 3 = end) {
+   ret = 0;
+   break;
+   }
name_len = ((name_len  0x7f)  24);
name_len |= (*p++  16);
name_len |= (*p++  8);
name_len |= *p++;
}
+   if (p = end) {
+   ret = 0;
+   break;
+   }
val_len = *p++;
if (val_len = 128) {
+   if (p + 3 = end) {
+   ret = 0;
+   break;
+   }
val_len = ((val_len  0x7f)  24);
val_len |= (*p++  16);
val_len |= (*p++  8);
val_len |= *p++;
}
-   if (name_len + val_len  0 ||
-   name_len + val_len  end - p) {
+   if (name_len + val_len  end - p) {
/* Malformated request */
ret = 0;
break;

Modified: php/php-src/trunk/sapi/cgi/fastcgi.c
===
--- php/php-src/trunk/sapi/cgi/fastcgi.c2011-01-19 07:27:40 UTC (rev 
307578)
+++ php/php-src/trunk/sapi/cgi/fastcgi.c2011-01-19 08:38:25 UTC (rev 
307579)
@@ -842,33 +842,33 @@
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char 
*end)
 {
unsigned int name_len, val_len;
-   int ret = 1;

while (p  end) {
name_len = *p++;
if (UNEXPECTED(name_len = 128)) {
+   if (UNEXPECTED(p + 3 = end)) return 0;
name_len = ((name_len  0x7f)  24);
name_len |= (*p++  16);
name_len |= (*p++  8);
name_len |= *p++;
}
+   if (UNEXPECTED(p = end)) return 0;
val_len = *p++;
if (UNEXPECTED(val_len = 128)) {
+   if (UNEXPECTED(p + 3 = end)) return 0;
val_len = ((val_len  0x7f)  24);
val_len |= (*p++  16);
val_len |= (*p++  8);
val_len |= *p++;
}
-   if (UNEXPECTED(name_len + val_len  0) ||
-   UNEXPECTED(name_len + val_len  (unsigned int) (end - p))) {
+   if (UNEXPECTED(name_len + val_len  (unsigned int) (end - p))) {
/* Malformated request */
-   ret = 0;
-   break;
+   return 0;
}
fcgi_hash_set(req-env, FCGI_HASH_FUNC(p, name_len), (char*)p, 
name_len, (char*)p + name_len, val_len);
p += name_len + val_len;
}
-   return ret;
+   return 1;
 }

 static int fcgi_read_request(fcgi_request *req)

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/rfc1867.c trunk/main/rfc1867.c

2011-01-19 Thread Ilia Alshanetsky
iliaaWed, 19 Jan 2011 13:09:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307583

Log:
Win32 build fix

Changed paths:
U   php/php-src/branches/PHP_5_3/main/rfc1867.c
U   php/php-src/trunk/main/rfc1867.c

Modified: php/php-src/branches/PHP_5_3/main/rfc1867.c
===
--- php/php-src/branches/PHP_5_3/main/rfc1867.c 2011-01-19 13:04:12 UTC (rev 
307582)
+++ php/php-src/branches/PHP_5_3/main/rfc1867.c 2011-01-19 13:09:05 UTC (rev 
307583)
@@ -989,8 +989,8 @@

/* New Rule: never repair potential malicious user 
input */
if (!skip_upload) {
+   long c = 0;
tmp = param;
-   long c = 0;

while (*tmp) {
if (*tmp == '[') {

Modified: php/php-src/trunk/main/rfc1867.c
===
--- php/php-src/trunk/main/rfc1867.c2011-01-19 13:04:12 UTC (rev 307582)
+++ php/php-src/trunk/main/rfc1867.c2011-01-19 13:09:05 UTC (rev 307583)
@@ -945,8 +945,8 @@

/* New Rule: never repair potential malicious user 
input */
if (!skip_upload) {
+   long c = 0;
tmp = param;
-   long c = 0;

while (*tmp) {
if (*tmp == '[') {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/php_ini.c trunk/main/php_ini.c

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 14:21:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307587

Log:
- path len check and fix buffer overrun

Changed paths:
U   php/php-src/branches/PHP_5_3/main/php_ini.c
U   php/php-src/trunk/main/php_ini.c

Modified: php/php-src/branches/PHP_5_3/main/php_ini.c
===
--- php/php-src/branches/PHP_5_3/main/php_ini.c 2011-01-19 14:07:37 UTC (rev 
307586)
+++ php/php-src/branches/PHP_5_3/main/php_ini.c 2011-01-19 14:21:46 UTC (rev 
307587)
@@ -824,12 +824,15 @@

 #if PHP_WIN32
char path_bak[MAXPATHLEN];
+#endif

if (path_len  MAXPATHLEN) {
return;
}
+
+#if PHP_WIN32
memcpy(path_bak, path, path_len);
-   path_bak[path_len] = 0;
+   path_bak[path_len - 1] = 0;
TRANSLATE_SLASHES_LOWER(path_bak);
path = path_bak;
 #endif

Modified: php/php-src/trunk/main/php_ini.c
===
--- php/php-src/trunk/main/php_ini.c2011-01-19 14:07:37 UTC (rev 307586)
+++ php/php-src/trunk/main/php_ini.c2011-01-19 14:21:46 UTC (rev 307587)
@@ -820,12 +820,15 @@

 #if PHP_WIN32
char path_bak[MAXPATHLEN];
+#endif

if (path_len  MAXPATHLEN) {
return;
}
+
+#if PHP_WIN32
memcpy(path_bak, path, path_len);
-   path_bak[path_len] = 0;
+   path_bak[path_len - 1] = 0;
TRANSLATE_SLASHES_LOWER(path_bak);
path = path_bak;
 #endif

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/zend_compile.c trunk/Zend/zend_compile.c

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 17:06:50 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307590

Log:
- avoid local redeclaration

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_compile.c2011-01-19 16:41:50 UTC 
(rev 307589)
+++ php/php-src/branches/PHP_5_3/Zend/zend_compile.c2011-01-19 17:06:50 UTC 
(rev 307590)
@@ -5220,13 +5220,13 @@
c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, 
Z_STRLEN_P(name)+1);
if (zend_hash_exists(CG(class_table), c_ns_name, 
Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
-   char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));
+   char *tmp2 = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));

if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) 
+ 1 + Z_STRLEN_P(name) ||
-   memcmp(tmp, c_ns_name, Z_STRLEN_P(ns))) {
+   memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) {
zend_error(E_COMPILE_ERROR, Cannot use %s as 
%s because the name is already in use, Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
-   efree(tmp);
+   efree(tmp2);
}
efree(c_ns_name);
} else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, 
(void**)pce) == SUCCESS 

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2011-01-19 16:41:50 UTC (rev 
307589)
+++ php/php-src/trunk/Zend/zend_compile.c   2011-01-19 17:06:50 UTC (rev 
307590)
@@ -6540,13 +6540,13 @@
c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, 
Z_STRLEN_P(name)+1);
if (zend_hash_exists(CG(class_table), c_ns_name, 
Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
-   char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));
+   char *tmp2 = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));

if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) 
+ 1 + Z_STRLEN_P(name) ||
-   memcmp(tmp, c_ns_name, Z_STRLEN_P(ns))) {
+   memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) {
zend_error(E_COMPILE_ERROR, Cannot use %s as 
%s because the name is already in use, Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
-   efree(tmp);
+   efree(tmp2);
}
efree(c_ns_name);
} else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, 
(void**)pce) == SUCCESS 

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/zend_compile.c trunk/Zend/zend_compile.c

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 17:17:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307591

Log:
- WS

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_compile.c	2011-01-19 17:06:50 UTC (rev 307590)
+++ php/php-src/branches/PHP_5_3/Zend/zend_compile.c	2011-01-19 17:17:52 UTC (rev 307591)
@@ -625,7 +625,7 @@
 	if (variable-op_type == IS_CV) {
 		if (variable-u.var == CG(active_op_array)-this_var) {
 			zend_error(E_COMPILE_ERROR, Cannot re-assign $this);
-	}
+		}
 	} else if (variable-op_type == IS_VAR) {
 		int n = 0;

@@ -705,7 +705,7 @@
 	if (lvar-op_type == IS_CV) {
 		if (lvar-u.var == CG(active_op_array)-this_var) {
  			zend_error(E_COMPILE_ERROR, Cannot re-assign $this);
-	}
+		}
 	} else if (lvar-op_type == IS_VAR) {
 		int last_op_number = get_next_op_number(CG(active_op_array));

@@ -1008,7 +1008,7 @@
 	variable-op_type = IS_CV;
 	variable-u.var = CG(active_op_array)-this_var;
 }
-		} else if (CG(active_op_array)-this_var == -1) {
+			} else if (CG(active_op_array)-this_var == -1) {
 CG(active_op_array)-this_var = lookup_cv(CG(active_op_array), estrndup(this, sizeof(this)-1), sizeof(this)-1);
 			}
 		}
@@ -1894,14 +1894,14 @@
 	long current, distance;

 	if (CG(labels) == NULL ||
-	zend_hash_find(CG(labels), Z_STRVAL(opline-op2.u.constant), Z_STRLEN(opline-op2.u.constant)+1, (void**)dest) == FAILURE) {
+		zend_hash_find(CG(labels), Z_STRVAL(opline-op2.u.constant), Z_STRLEN(opline-op2.u.constant)+1, (void**)dest) == FAILURE) {

-	if (pass2) {
-		CG(in_compilation) = 1;
-		CG(active_op_array) = op_array;
-		CG(zend_lineno) = opline-lineno;
+		if (pass2) {
+			CG(in_compilation) = 1;
+			CG(active_op_array) = op_array;
+			CG(zend_lineno) = opline-lineno;
 			zend_error(E_COMPILE_ERROR, 'goto' to undefined label '%s', Z_STRVAL(opline-op2.u.constant));
-	} else {
+		} else {
 			/* Label is not defined. Delay to pass 2. */
 			INC_BPC(op_array);
 			return;
@@ -1915,11 +1915,11 @@
 	current = opline-extended_value;
 	for (distance = 0; current != dest-brk_cont; distance++) {
 		if (current == -1) {
-		if (pass2) {
-			CG(in_compilation) = 1;
-			CG(active_op_array) = op_array;
-			CG(zend_lineno) = opline-lineno;
-		}
+			if (pass2) {
+CG(in_compilation) = 1;
+CG(active_op_array) = op_array;
+CG(zend_lineno) = opline-lineno;
+			}
 			zend_error(E_COMPILE_ERROR, 'goto' into loop or switch statement is disallowed);
 		}
 		current = op_array-brk_cont_array[current].parent;
@@ -1935,9 +1935,9 @@
 		ZVAL_LONG(opline-op2.u.constant, distance);
 	}

-if (pass2) {
+	if (pass2) {
 		DEC_BPC(op_array);
-}
+	}
 }
 /* }}} */

@@ -2009,7 +2009,7 @@
 	if (method_name-op_type == IS_CONST) {
 		char *lcname = zend_str_tolower_dup(Z_STRVAL(method_name-u.constant), Z_STRLEN(method_name-u.constant));
 		if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name-u.constant) 
-		memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
+			memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
 			zval_dtor(method_name-u.constant);
 			SET_UNUSED(*method_name);
 		}
@@ -2017,7 +2017,7 @@
 	}

 	if (class_name-op_type == IS_CONST 
-	ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name-u.constant), Z_STRLEN(class_name-u.constant))) {
+			ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name-u.constant), Z_STRLEN(class_name-u.constant))) {
 		fetch_type = ZEND_FETCH_CLASS_GLOBAL;
 		zend_resolve_class_name(class_name, fetch_type, 1 TSRMLS_CC);
 		class_node = *class_name;
@@ -2080,9 +2080,9 @@

 	if (original_op == ZEND_SEND_REF  !CG(allow_call_time_pass_reference)) {
 		if (function_ptr 
-		function_ptr-common.function_name 
-		function_ptr-common.type == ZEND_USER_FUNCTION 
-		!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
+function_ptr-common.function_name 
+function_ptr-common.type == ZEND_USER_FUNCTION 
+!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
 			zend_error(E_DEPRECATED,
 		Call-time pass-by-reference has been deprecated; 
 		If you would like to pass it by reference, modify the declaration of %s().  
@@ -2572,9 +2572,9 @@
 			char *colon;

 			if (fe-common.type != ZEND_USER_FUNCTION ||
-			strchr(proto-common.arg_info[i].class_name, '\\') != NULL ||
-			(colon = zend_memrchr(fe-common.arg_info[i].class_name, '\\', fe-common.arg_info[i].class_name_len)) == NULL ||
-			strcasecmp(colon+1, proto-common.arg_info[i].class_name) != 0) {
+	strchr(proto-common.arg_info[i].class_name, '\\') != NULL ||
+	(colon = 

[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd.c mysqlnd_statistics.c

2011-01-19 Thread Andrey Hristov
andrey   Wed, 19 Jan 2011 17:51:02 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307592

Log:
fix ZTS build

Changed paths:
U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c 2011-01-19 17:17:52 UTC (rev 
307591)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c 2011-01-19 17:51:02 UTC (rev 
307592)
@@ -2307,7 +2307,7 @@
conn-net = mysqlnd_net_init(conn-persistent TSRMLS_CC);
conn-protocol = mysqlnd_protocol_init(conn-persistent TSRMLS_CC);

-   DBG_RETURN(conn-net  conn-protocol? PASS:FAIL);
+   DBG_RETURN(conn-stats  conn-net  conn-protocol? PASS:FAIL);
 }
 /* }}} */


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c  2011-01-19 17:17:52 UTC 
(rev 307591)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c  2011-01-19 17:51:02 UTC 
(rev 307592)
@@ -246,7 +246,6 @@
 {
*stats = calloc(1, sizeof(MYSQLND_STATS));
if (*stats == NULL) {
-   DBG_ENTER(mysqlnd_stats_init failed to calloc stats context);
return;
}
(*stats)-values = calloc(statistic_count, sizeof(uint64_t));
@@ -256,7 +255,6 @@
 #ifdef ZTS
(*stats)-LOCK_access = tsrm_mutex_alloc();
 #endif
-
 }
 /* }}} */


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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_statistics.c

2011-01-19 Thread Andrey Hristov
andrey   Wed, 19 Jan 2011 18:09:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307593

Log:
fix zts build

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c   
2011-01-19 17:51:02 UTC (rev 307592)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c   
2011-01-19 18:09:17 UTC (rev 307593)
@@ -248,7 +248,6 @@
 {
*stats = calloc(1, sizeof(MYSQLND_STATS));
if (*stats == NULL) {
-   DBG_ENTER(mysqlnd_stats_init failed to calloc stats context);
return;
}
(*stats)-values = calloc(statistic_count, sizeof(uint64_t));

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

[PHP-CVS] svn: /php/php-src/trunk/win32/ inet.h

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 19:48:28 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307596

Log:
- xp sp3 does not have them

Changed paths:
U   php/php-src/trunk/win32/inet.h

Modified: php/php-src/trunk/win32/inet.h
===
--- php/php-src/trunk/win32/inet.h  2011-01-19 19:45:26 UTC (rev 307595)
+++ php/php-src/trunk/win32/inet.h  2011-01-19 19:48:28 UTC (rev 307596)
@@ -3,7 +3,7 @@
 #endif
 #include Ws2tcpip.h

-#if (_WIN32_WINNT = 0x500)
+#if (_WIN32_WINNT = 0x502)
 PHPAPI int inet_pton(int af, const char* src, void* dst);
 PHPAPI const char* inet_ntop(int af, const void* src, char* dst, size_t size);
 PHPAPI int inet_aton(const char *cp, struct in_addr *inp);

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

[PHP-CVS] svn: /php/win-installer/trunk/ PHPInstallerScripts52.vbs PHPInstallerScripts53.vbs PHPInstallerScripts60.vbs

2011-01-19 Thread John Mertic
jmertic  Wed, 19 Jan 2011 20:54:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307597

Log:
Bug 53689 - Fixed typo in the scripts that add the httpd.conf entries.

Bug: http://bugs.php.net/53689 (Open) Installer fails to enter PHP-path into 
httpd.conf
  
Changed paths:
U   php/win-installer/trunk/PHPInstallerScripts52.vbs
U   php/win-installer/trunk/PHPInstallerScripts53.vbs
U   php/win-installer/trunk/PHPInstallerScripts60.vbs

Modified: php/win-installer/trunk/PHPInstallerScripts52.vbs
===
--- php/win-installer/trunk/PHPInstallerScripts52.vbs   2011-01-19 19:48:28 UTC 
(rev 307596)
+++ php/win-installer/trunk/PHPInstallerScripts52.vbs   2011-01-19 20:54:39 UTC 
(rev 307597)
@@ -14,8 +14,7 @@
 If ( right(strApacheDir,1)  \ ) then
 strApacheDir = strApacheDir  \
 End If
-' Bug 52753 - Comment out since it causes an invalid http.conf file
-' strPHPPath = Replace(strInstallDir,\,/)
+strPHPPath = strInstallDir

 strDirective = vbCrLf  vbCrLf  #BEGIN PHP INSTALLER EDITS - REMOVE ONLY 
ON UNINSTALL  vbCrLf
 If ( strWebServerType = apacheCGI ) Then

Modified: php/win-installer/trunk/PHPInstallerScripts53.vbs
===
--- php/win-installer/trunk/PHPInstallerScripts53.vbs   2011-01-19 19:48:28 UTC 
(rev 307596)
+++ php/win-installer/trunk/PHPInstallerScripts53.vbs   2011-01-19 20:54:39 UTC 
(rev 307597)
@@ -14,8 +14,7 @@
 If ( right(strApacheDir,1)  \ ) then
 strApacheDir = strApacheDir  \
 End If
-' Bug 52753 - Comment out since it causes an invalid http.conf file
-' strPHPPath = Replace(strInstallDir,\,/)
+strPHPPath = strInstallDir

 strDirective = vbCrLf  vbCrLf  #BEGIN PHP INSTALLER EDITS - REMOVE ONLY 
ON UNINSTALL  vbCrLf
 If ( strWebServerType = apacheCGI ) Then

Modified: php/win-installer/trunk/PHPInstallerScripts60.vbs
===
--- php/win-installer/trunk/PHPInstallerScripts60.vbs   2011-01-19 19:48:28 UTC 
(rev 307596)
+++ php/win-installer/trunk/PHPInstallerScripts60.vbs   2011-01-19 20:54:39 UTC 
(rev 307597)
@@ -14,8 +14,7 @@
 If ( right(strApacheDir,1)  \ ) then
 strApacheDir = strApacheDir  \
 End If
-' Bug 52753 - Comment out since it causes an invalid http.conf file
-' strPHPPath = Replace(strInstallDir,\,/)
+strPHPPath = strInstallDir

 strDirective = vbCrLf  vbCrLf  #BEGIN PHP INSTALLER EDITS - REMOVE ONLY 
ON UNINSTALL  vbCrLf
 If ( strWebServerType = apacheCGI ) Then

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mcrypt/config.w32 trunk/ext/mcrypt/config.w32

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 21:19:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307599

Log:
- force static, can't be built yet shared anyway

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mcrypt/config.w32
U   php/php-src/trunk/ext/mcrypt/config.w32

Modified: php/php-src/branches/PHP_5_3/ext/mcrypt/config.w32
===
--- php/php-src/branches/PHP_5_3/ext/mcrypt/config.w32  2011-01-19 21:05:32 UTC 
(rev 307598)
+++ php/php-src/branches/PHP_5_3/ext/mcrypt/config.w32  2011-01-19 21:19:45 UTC 
(rev 307599)
@@ -9,7 +9,8 @@
CHECK_LIB('libmcrypt_a.lib;libmcrypt.lib', 'mcrypt') 
CHECK_LIB('Advapi32.lib', 'mcrypt')
) {
-   EXTENSION('mcrypt', 'mcrypt.c mcrypt_filter.c', 
PHP_MCRYPT_SHARED);
+
+   EXTENSION('mcrypt', 'mcrypt.c mcrypt_filter.c', false);
AC_DEFINE('HAVE_LIBMCRYPT', 1);
AC_DEFINE('HAVE_LIBMCRYPT24', 1);
} else {

Modified: php/php-src/trunk/ext/mcrypt/config.w32
===
--- php/php-src/trunk/ext/mcrypt/config.w32 2011-01-19 21:05:32 UTC (rev 
307598)
+++ php/php-src/trunk/ext/mcrypt/config.w32 2011-01-19 21:19:45 UTC (rev 
307599)
@@ -9,7 +9,8 @@
CHECK_LIB('libmcrypt_a.lib;libmcrypt.lib', 'mcrypt') 
CHECK_LIB('Advapi32.lib', 'mcrypt')
) {
-   EXTENSION('mcrypt', 'mcrypt.c mcrypt_filter.c', 
PHP_MCRYPT_SHARED);
+
+   EXTENSION('mcrypt', 'mcrypt.c mcrypt_filter.c', false);
AC_DEFINE('HAVE_LIBMCRYPT', 1);
AC_DEFINE('HAVE_LIBMCRYPT24', 1);
} else {

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 21:40:15 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307600

Log:
- fix warning about undefined zend_multibyte_set_filter and 
zend_multibyte_yyinput_again, why are they not in zend_multibyte.h btw?

Changed paths:
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2011-01-19 21:19:45 UTC (rev 
307599)
+++ php/php-src/trunk/Zend/zend_compile.c   2011-01-19 21:40:15 UTC (rev 
307600)
@@ -28,6 +28,7 @@
 #include zend_exceptions.h
 #include tsrm_virtual_cwd.h
 #include zend_multibyte.h
+#include zend_language_scanner.h

 #define CONSTANT_EX(op_array, op) \
(op_array)-literals[op].constant

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

[PHP-CVS] svn: /php/php-src/trunk/ UPGRADING

2011-01-19 Thread Philip Olson
philip   Wed, 19 Jan 2011 22:41:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307602

Log:
Fixed a couple of trivial typos

Changed paths:
U   php/php-src/trunk/UPGRADING

Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING 2011-01-19 22:28:08 UTC (rev 307601)
+++ php/php-src/trunk/UPGRADING 2011-01-19 22:41:01 UTC (rev 307602)
@@ -134,10 +134,10 @@
   the validity of the entities. Numerical entities are checked for a valid
   range (0 to 0x10); if the flag ENT_DISALLOWED is given, the validity of
   such numerical entity in the target document type is also checked.  Named
-  entitities are checked for necessary existence in the target document type
+  entities are checked for necessary existence in the target document type
   instead of only checking whether they were constituted by alphanumeric
   characters.
-- The flag ENT_DISALLOWED was addded. In addition to the behavior described in
+- The flag ENT_DISALLOWED was added. In addition to the behavior described in
   the item before, it also makes htmlentities/htmlspecialchars substitute
   characters that appear literally in the argument string and which are not
   allowed in the target document type with U+FFFD (UTF-8) or #xFFFD;.

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/gd/gdcache.c trunk/ext/gd/gdcache.c

2011-01-19 Thread Pierre Joye
pajoye   Wed, 19 Jan 2011 15:23:07 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307588

Log:
- malloc may fail

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/gd/gdcache.c
U   php/php-src/trunk/ext/gd/gdcache.c

Modified: php/php-src/branches/PHP_5_3/ext/gd/gdcache.c
===
--- php/php-src/branches/PHP_5_3/ext/gd/gdcache.c   2011-01-19 14:21:46 UTC 
(rev 307587)
+++ php/php-src/branches/PHP_5_3/ext/gd/gdcache.c   2011-01-19 15:23:07 UTC 
(rev 307588)
@@ -159,6 +159,9 @@
key_value_t *map;

map = (key_value_t *)malloc(sizeof(key_value_t));
+   if (map == NULL) {
+   return NULL;
+   }
map-key = *(int *)key;
map-value = 3;


Modified: php/php-src/trunk/ext/gd/gdcache.c
===
--- php/php-src/trunk/ext/gd/gdcache.c  2011-01-19 14:21:46 UTC (rev 307587)
+++ php/php-src/trunk/ext/gd/gdcache.c  2011-01-19 15:23:07 UTC (rev 307588)
@@ -159,6 +159,9 @@
key_value_t *map;

map = (key_value_t *)malloc(sizeof(key_value_t));
+   if (map == NULL) {
+   return NULL;
+   }
map-key = *(int *)key;
map-value = 3;


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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/main.c trunk/main/main.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 06:23:35 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307610

Log:
- check if strdup succeeds

Changed paths:
U   php/php-src/branches/PHP_5_3/main/main.c
U   php/php-src/trunk/main/main.c

Modified: php/php-src/branches/PHP_5_3/main/main.c
===
--- php/php-src/branches/PHP_5_3/main/main.c2011-01-20 01:59:14 UTC (rev 
307609)
+++ php/php-src/branches/PHP_5_3/main/main.c2011-01-20 06:23:35 UTC (rev 
307610)
@@ -179,7 +179,9 @@
}

e = PG(disable_functions) = strdup(INI_STR(disable_functions));
-
+   if (e == NULL) {
+   return;
+   }
while (*e) {
switch (*e) {
case ' ':
@@ -1672,8 +1674,9 @@
 {
 #ifdef PHP_WIN32
if (!PG(com_initialized)) {
-   CoInitialize(NULL);
-   PG(com_initialized) = 1;
+   if (CoInitialize(NULL) == S_OK) {
+   PG(com_initialized) = 1;
+   }
}
 #endif
 }

Modified: php/php-src/trunk/main/main.c
===
--- php/php-src/trunk/main/main.c   2011-01-20 01:59:14 UTC (rev 307609)
+++ php/php-src/trunk/main/main.c   2011-01-20 06:23:35 UTC (rev 307610)
@@ -180,7 +180,9 @@
}

e = PG(disable_functions) = strdup(INI_STR(disable_functions));
-
+   if (e == NULL) {
+   return;
+   }
while (*e) {
switch (*e) {
case ' ':
@@ -1715,8 +1717,9 @@
 {
 #ifdef PHP_WIN32
if (!PG(com_initialized)) {
-   CoInitialize(NULL);
-   PG(com_initialized) = 1;
+   if (CoInitialize(NULL) == S_OK) {
+   PG(com_initialized) = 1;
+   }
}
 #endif
 }
@@ -1820,6 +1823,7 @@
}
 }
 #endif
+EXTERN_C IMAGE_DOS_HEADER __ImageBase;

 /* {{{ php_module_startup
  */
@@ -1835,6 +1839,10 @@
void ***tsrm_ls;
php_core_globals *core_globals;
 #endif
+#ifdef PHP_WIN32
+   char module_path[MAX_PATH];
+#endif
+
 #if defined(PHP_WIN32) || (defined(NETWARE)  defined(USE_WINSOCK))
WORD wVersionRequested = MAKEWORD(2, 0);
WSADATA wsaData;
@@ -1854,7 +1862,15 @@
 #else
php_os=PHP_OS;
 #endif
-
+   GetModuleFileName((HINSTANCE)__ImageBase, module_path, MAX_PATH);
+   php_dirname(module_path, strlen(module_path));
+   {
+   char dll_dir[MAX_PATH];
+   sprintf(dll_dir, %s\\%s, module_path, ..\\..\\deps\\bin);
+   SetDllDirectory(dll_dir);
+   }
+// GetModuleFileName (NULL, module_path, MAX_PATH);
+//__debugbreak();
 #ifdef ZTS
tsrm_ls = ts_resource(0);
 #endif

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/cast.c trunk/main/streams/cast.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 06:32:59 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307611

Log:
- no need of assert here

Changed paths:
U   php/php-src/branches/PHP_5_3/main/streams/cast.c
U   php/php-src/trunk/main/streams/cast.c

Modified: php/php-src/branches/PHP_5_3/main/streams/cast.c
===
--- php/php-src/branches/PHP_5_3/main/streams/cast.c2011-01-20 06:23:35 UTC 
(rev 307610)
+++ php/php-src/branches/PHP_5_3/main/streams/cast.c2011-01-20 06:32:59 UTC 
(rev 307611)
@@ -366,8 +366,9 @@
 /* {{{ php_stream_make_seekable */
 PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream 
**newstream, int flags STREAMS_DC TSRMLS_DC)
 {
-   assert(newstream != NULL);
-
+   if (newstream == NULL) {
+   return PHP_STREAM_FAILED;
+   }
*newstream = NULL;

if (((flags  PHP_STREAM_FORCE_CONVERSION) == 0)  
origstream-ops-seek != NULL) {

Modified: php/php-src/trunk/main/streams/cast.c
===
--- php/php-src/trunk/main/streams/cast.c   2011-01-20 06:23:35 UTC (rev 
307610)
+++ php/php-src/trunk/main/streams/cast.c   2011-01-20 06:32:59 UTC (rev 
307611)
@@ -366,8 +366,9 @@
 /* {{{ php_stream_make_seekable */
 PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream 
**newstream, int flags STREAMS_DC TSRMLS_DC)
 {
-   assert(newstream != NULL);
-
+   if (newstream == NULL) {
+   return PHP_STREAM_FAILED;
+   }
*newstream = NULL;

if (((flags  PHP_STREAM_FORCE_CONVERSION) == 0)  
origstream-ops-seek != NULL) {

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

[PHP-CVS] svn: /php/php-src/trunk/ext/com_dotnet/ com_olechar.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 06:44:16 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307612

Log:
- init err

Changed paths:
U   php/php-src/trunk/ext/com_dotnet/com_olechar.c

Modified: php/php-src/trunk/ext/com_dotnet/com_olechar.c
===
--- php/php-src/trunk/ext/com_dotnet/com_olechar.c  2011-01-20 06:32:59 UTC 
(rev 307611)
+++ php/php-src/trunk/ext/com_dotnet/com_olechar.c  2011-01-20 06:44:16 UTC 
(rev 307612)
@@ -79,7 +79,6 @@
length = WideCharToMultiByte(codepage, 0, olestring, -1, 
string, length, NULL, NULL);
ok = length  0;
} else {
-   err = GetLastError();
string = (char*)emalloc(sizeof(char));
*string = '\0';
ok = FALSE;
@@ -87,7 +86,9 @@
}

if (!ok) {
-   char *msg = php_win32_error_to_msg(err);
+   char *msg;
+   err = GetLastError();
+   msg = php_win32_error_to_msg(err);

php_error_docref(NULL TSRMLS_CC, E_WARNING,
Could not convert string from unicode: `%s', msg);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/com_dotnet/com_olechar.c trunk/ext/com_dotnet/com_olechar.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 06:45:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307613

Log:
- init err (and simplify)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/com_dotnet/com_olechar.c
U   php/php-src/trunk/ext/com_dotnet/com_olechar.c

Modified: php/php-src/branches/PHP_5_3/ext/com_dotnet/com_olechar.c
===
--- php/php-src/branches/PHP_5_3/ext/com_dotnet/com_olechar.c   2011-01-20 
06:44:16 UTC (rev 307612)
+++ php/php-src/branches/PHP_5_3/ext/com_dotnet/com_olechar.c   2011-01-20 
06:45:52 UTC (rev 307613)
@@ -79,7 +79,6 @@
length = WideCharToMultiByte(codepage, 0, olestring, -1, 
string, length, NULL, NULL);
ok = length  0;
} else {
-   err = GetLastError();
string = (char*)emalloc(sizeof(char));
*string = '\0';
ok = FALSE;
@@ -87,7 +86,7 @@
}

if (!ok) {
-   char *msg = php_win_err(err);
+   char *msg = php_win32_error_to_msg(GetLastError());

php_error_docref(NULL TSRMLS_CC, E_WARNING,
Could not convert string from unicode: `%s', msg);

Modified: php/php-src/trunk/ext/com_dotnet/com_olechar.c
===
--- php/php-src/trunk/ext/com_dotnet/com_olechar.c  2011-01-20 06:44:16 UTC 
(rev 307612)
+++ php/php-src/trunk/ext/com_dotnet/com_olechar.c  2011-01-20 06:45:52 UTC 
(rev 307613)
@@ -86,9 +86,7 @@
}

if (!ok) {
-   char *msg;
-   err = GetLastError();
-   msg = php_win32_error_to_msg(err);
+   char *msg = php_win32_error_to_msg(GetLastError());

php_error_docref(NULL TSRMLS_CC, E_WARNING,
Could not convert string from unicode: `%s', msg);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/com_dotnet/com_typeinfo.c trunk/ext/com_dotnet/com_typeinfo.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 06:49:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307614

Log:
- kill local redeclaration

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/com_dotnet/com_typeinfo.c
U   php/php-src/trunk/ext/com_dotnet/com_typeinfo.c

Modified: php/php-src/branches/PHP_5_3/ext/com_dotnet/com_typeinfo.c
===
--- php/php-src/branches/PHP_5_3/ext/com_dotnet/com_typeinfo.c  2011-01-20 
06:45:52 UTC (rev 307613)
+++ php/php-src/branches/PHP_5_3/ext/com_dotnet/com_typeinfo.c  2011-01-20 
06:49:17 UTC (rev 307614)
@@ -120,14 +120,14 @@
if 
(ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, libnamelen)) {
if (0 
== stricmp(libname, search_string)) {

char *str = NULL;
-   
int major, minor;
+   
int major_tmp, minor_tmp;


/* fetch the GUID and add the version numbers */
-   
if (2 != sscanf(version, %d.%d, major, minor)) {
-   
major = 1;
-   
minor = 0;
+   
if (2 != sscanf(version, %d.%d, major_tmp, minor_tmp)) {
+   
major_tmp = 1;
+   
minor_tmp = 0;

}
-   
spprintf(str, 0, %s,%d,%d, keyname, major, minor);
+   
spprintf(str, 0, %s,%d,%d, keyname, major_tmp, minor_tmp);

/* recurse */

TL = php_com_load_typelib(str, codepage TSRMLS_CC);


Modified: php/php-src/trunk/ext/com_dotnet/com_typeinfo.c
===
--- php/php-src/trunk/ext/com_dotnet/com_typeinfo.c 2011-01-20 06:45:52 UTC 
(rev 307613)
+++ php/php-src/trunk/ext/com_dotnet/com_typeinfo.c 2011-01-20 06:49:17 UTC 
(rev 307614)
@@ -120,14 +120,14 @@
if 
(ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, libnamelen)) {
if (0 
== stricmp(libname, search_string)) {

char *str = NULL;
-   
int major, minor;
+   
int major_tmp, minor_tmp;


/* fetch the GUID and add the version numbers */
-   
if (2 != sscanf(version, %d.%d, major, minor)) {
-   
major = 1;
-   
minor = 0;
+   
if (2 != sscanf(version, %d.%d, major_tmp, minor_tmp)) {
+   
major_tmp = 1;
+   
minor_tmp = 0;

}
-   
spprintf(str, 0, %s,%d,%d, keyname, major, minor);
+   
spprintf(str, 0, %s,%d,%d, keyname, major_tmp, minor_tmp);

/* recurse */

TL = php_com_load_typelib(str, codepage TSRMLS_CC);


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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/com_dotnet/com_variant.c trunk/ext/com_dotnet/com_variant.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 06:58:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307617

Log:
- fail when no known op are given

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/com_dotnet/com_variant.c
U   php/php-src/trunk/ext/com_dotnet/com_variant.c

Modified: php/php-src/branches/PHP_5_3/ext/com_dotnet/com_variant.c
===
--- php/php-src/branches/PHP_5_3/ext/com_dotnet/com_variant.c   2011-01-20 
06:55:11 UTC (rev 307616)
+++ php/php-src/branches/PHP_5_3/ext/com_dotnet/com_variant.c   2011-01-20 
06:58:04 UTC (rev 307617)
@@ -755,6 +755,8 @@
case VOP_NOT:
result = VarNot(vleft, vres);
break;
+   default:
+   result = E_INVALIDARG;
}

if (SUCCEEDED(result)) {

Modified: php/php-src/trunk/ext/com_dotnet/com_variant.c
===
--- php/php-src/trunk/ext/com_dotnet/com_variant.c  2011-01-20 06:55:11 UTC 
(rev 307616)
+++ php/php-src/trunk/ext/com_dotnet/com_variant.c  2011-01-20 06:58:04 UTC 
(rev 307617)
@@ -755,6 +755,8 @@
case VOP_NOT:
result = VarNot(vleft, vres);
break;
+   default:
+   result = E_INVALIDARG;
}

if (SUCCEEDED(result)) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 07:05:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307618

Log:
- be sure that we got tzid by adding a default case

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/trunk/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-20 06:58:04 UTC 
(rev 307617)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-20 07:05:34 UTC 
(rev 307618)
@@ -889,17 +889,6 @@

switch (GetTimeZoneInformation(tzi))
{
-   /* no DST or not in effect */
-   case TIME_ZONE_ID_UNKNOWN:
-   case TIME_ZONE_ID_STANDARD:
-php_win_std_time:
-   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.StandardBias) * -60, 0);
-   if (! tzid) {
-   tzid = UTC;
-   }
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/no DST' instead, tzid, ((tzi.Bias + 
tzi.StandardBias) / -60.0));
-   break;
-
/* DST in effect */
case TIME_ZONE_ID_DAYLIGHT:
/* If user has disabled DST in the control 
panel, Windows returns 0 here */
@@ -908,11 +897,24 @@
}

tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.DaylightBias) * -60, 1);
-   if (! tzid) {
+   if (tzid == NULL) {
tzid = UTC;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/DST' instead, tzid, ((tzi.Bias + 
tzi.DaylightBias) / -60.0));
break;
+
+   /* no DST or not in effect */
+   case TIME_ZONE_ID_UNKNOWN:
+   case TIME_ZONE_ID_STANDARD:
+   default:
+php_win_std_time:
+   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.StandardBias) * -60, 0);
+   if (! tzid) {
+   tzid = UTC;
+   }
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/no DST' instead, tzid, ((tzi.Bias + 
tzi.StandardBias) / -60.0));
+   break;
+
}
return tzid;
}

Modified: php/php-src/trunk/ext/date/php_date.c
===
--- php/php-src/trunk/ext/date/php_date.c   2011-01-20 06:58:04 UTC (rev 
307617)
+++ php/php-src/trunk/ext/date/php_date.c   2011-01-20 07:05:34 UTC (rev 
307618)
@@ -889,17 +889,6 @@

switch (GetTimeZoneInformation(tzi))
{
-   /* no DST or not in effect */
-   case TIME_ZONE_ID_UNKNOWN:
-   case TIME_ZONE_ID_STANDARD:
-php_win_std_time:
-   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.StandardBias) * -60, 0);
-   if (! tzid) {
-   tzid = UTC;
-   }
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/no DST' instead, tzid, ((tzi.Bias + 
tzi.StandardBias) / -60.0));
-   break;
-
/* DST in effect */
case TIME_ZONE_ID_DAYLIGHT:
/* If user has disabled DST in the control 
panel, Windows returns 0 here */
@@ -908,11 +897,24 @@
}

tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.DaylightBias) * -60, 1);
-   if (! tzid) {
+   if (tzid == NULL) {
tzid = UTC;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/DST' instead, tzid, ((tzi.Bias + 
tzi.DaylightBias) / -60.0));
break;
+
+   /* no DST or not in effect */
+   case TIME_ZONE_ID_UNKNOWN:
+   case TIME_ZONE_ID_STANDARD:
+   default:
+php_win_std_time:
+   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/plain_wrapper.c trunk/main/streams/plain_wrapper.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 07:38:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307619

Log:
- don't continue if no valid option value

Changed paths:
U   php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c
U   php/php-src/trunk/main/streams/plain_wrapper.c

Modified: php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c
===
--- php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c   2011-01-20 
07:05:34 UTC (rev 307618)
+++ php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c   2011-01-20 
07:38:00 UTC (rev 307619)
@@ -713,6 +713,8 @@
acc = 
FILE_MAP_READ | FILE_MAP_WRITE;
/* TODO: we 
should assign a name for the mapping */
break;
+   default:
+   return 
PHP_STREAM_OPTION_RETURN_ERR;
}

/* create a mapping capable of 
viewing the whole file (this costs no real resources) */

Modified: php/php-src/trunk/main/streams/plain_wrapper.c
===
--- php/php-src/trunk/main/streams/plain_wrapper.c  2011-01-20 07:05:34 UTC 
(rev 307618)
+++ php/php-src/trunk/main/streams/plain_wrapper.c  2011-01-20 07:38:00 UTC 
(rev 307619)
@@ -713,6 +713,8 @@
acc = 
FILE_MAP_READ | FILE_MAP_WRITE;
/* TODO: we 
should assign a name for the mapping */
break;
+   default:
+   return 
PHP_STREAM_OPTION_RETURN_ERR;
}

/* create a mapping capable of 
viewing the whole file (this costs no real resources) */

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