Compare commits

..
Author SHA1 Message Date
SVN Migration 01c0f92eb9 This commit was manufactured by cvs2svn to create tag 'php_4_3_10RC2'. 2004-12-08 01:09:54 +00:00
Ilia Alshanetsky eea7fbdd4f 4.3.10RC2 2004-12-08 01:09:53 +00:00
Antony Dovgal dcfe66f9d7 MFH: fix leak 2004-12-07 17:04:42 +00:00
Antony Dovgal 61442c339f revert it 2004-12-07 14:01:56 +00:00
Derick Rethans 3d2bc043a7 - Tidy up NEWS a bit. 2004-12-07 08:42:50 +00:00
Antony Dovgal 2381aecca9 fix bug #30232 (session_start() sends Set-Cookie header only if the cookie is not set yet)
# looks like somebody fixed it in HEAD and forgot to MFH it..
2004-12-07 08:21:38 +00:00
Ilia Alshanetsky 14c6cd1788 MFh: Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). 2004-12-07 00:34:33 +00:00
Ilia Alshanetsky d059006b67 MFH: Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). 2004-12-06 23:31:58 +00:00
Derick Rethans 95d9d7069a - Install the iconv extension headers to <installpath>/ext/iconv so that
external extensions can use them.
2004-12-06 20:37:56 +00:00
Ilia Alshanetsky aea33db8bb Revert, this is not needed after all. 2004-12-06 19:44:33 +00:00
Stanislav Malyshev 9ab7598560 fix startup - if startup did not succeed, do not continue with execution 2004-12-06 18:55:16 +00:00
Stanislav Malyshev a21c4e544f do not zero out peak - MM shutdown would do that 2004-12-06 18:51:40 +00:00
Ilia Alshanetsky ccbb17575a As per discussion on internals and pecl, domxml is no longer experimental. 2004-12-05 19:08:56 +00:00
Holger Zimmermann 0cd60dedad Replaced static server variables by function call and configurable list at the Pi3Web server side. 2004-12-05 09:48:48 +00:00
Stefan Esser 1686229772 fix compile 2004-12-03 16:09:19 +00:00
Stefan Esser 0520c88818 MFH 2004-12-03 16:04:26 +00:00
Christian Stocker bc0b61d250 - remove EXPERIMENTAL tag 2004-12-03 15:53:02 +00:00
Ilia Alshanetsky fa3568d490 MFH: Fixed bug #30962 (mssql returns space for NULL columns). 2004-12-03 02:27:11 +00:00
Antony Dovgal 84b568c4be MFH: revert my last patch 2004-12-02 16:36:41 +00:00
Stefan Esser ef56c2d1ee MFH 2004-12-02 01:04:46 +00:00
Stefan Esser aa65def360 MFH 2004-12-02 00:44:33 +00:00
Stefan Esser 26b45cf15f Fixed missing opening bracket 2004-12-01 23:47:54 +00:00
Stefan Esser 8aa0e89801 MFH 2004-12-01 22:56:33 +00:00
Stefan Esser 0c23ef8d85 MFH 2004-12-01 22:42:26 +00:00
Derick Rethans aa3971b119 - Update INSTALL file (to add static instructions) 2004-12-01 09:15:06 +00:00
Derick Rethans 5cc3311229 - MFH: Added testcase for bug #30695 2004-11-29 10:15:22 +00:00
SVN Migration 78388bd7c5 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-11-29 10:15:04 +00:00
Derick Rethans 5742bd2c52 - Make it work with PDFLib 5 again (And the check for PDFLib 6 is gone). 2004-11-29 09:13:39 +00:00
Sergey Kartashoff 169205c41a # - MnoGoSearch extension latest patch reverted (part3) 2004-11-28 20:33:12 +00:00
Sergey Kartashoff 7335ef4d30 - MnoGoSearch extension latest patch reverted (part2) 2004-11-28 20:31:37 +00:00
Sergey Kartashoff fb8f2ff8e4 - MnoGoSearch extension latest patch reverted 2004-11-28 20:30:09 +00:00
Sergey Kartashoff 918be06876 - MnoGoSearch extension updated to fix compilation issues with
mnogosearch-3.2.25+
2004-11-28 20:03:30 +00:00
Antony Dovgal 909ad657e1 BFN + change my mail to my name 2004-11-28 17:15:30 +00:00
Antony Dovgal 2abee83ee1 MFH: fix #29954 (array_reduce segfaults when initial value is array) 2004-11-28 17:12:59 +00:00
Stefan Esser a09961a655 MFH 2004-11-28 12:44:56 +00:00
Jon Parise 07392ae5f1 Distribute Net_SMTP 1.2.6 instead of 1.2.3. The former includes a year's
worth of additional bug fixes and improvements, and it has been a stable
release for over six months.

PEAR Bug: 2839
2004-11-27 21:31:10 +00:00
Ilia Alshanetsky 6fcaae369a MFH: Improve offset check inside shmop_write(). 2004-11-27 18:18:19 +00:00
Ilia Alshanetsky c30a032552 Back to dev. 2004-11-23 14:56:29 +00:00
26 changed files with 893 additions and 602 deletions

No files matched your search

+1 -1
View File
@@ -262,7 +262,7 @@ STATUS: Unknown
EXTENSION: domxml
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: dotnet
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
+620 -436
View File
File diff suppressed because it is too large. Load diff
+8 -5
View File
@@ -1,6 +1,8 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Nov 2004, Version 4.3.10
07 Dec 2004, Version 4.3.10RC2
- Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). (Ilia)
- Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). (Ilia)
23 Nov 2004, Version 4.3.10RC1
- Added the %F modifier to *printf to render a non-locale-aware representation
@@ -12,7 +14,7 @@ PHP 4 NEWS
properly). (Ilia)
- Fixed bug #30750 (Meaningful error message when upload directory is not
accessible). (Ilia)
- Fixed bug #30739 (imagefill does not set back alphablending mode) (Pierre)
- Fixed bug #30739 (imagefill does not set back alphablending mode). (Pierre)
- Fixed bug #30672 (Problem handling exif data in jpeg images at unusual
places). (Marcus)
- Fixed bug #30658 (Ensure that temporary files created by GD are removed).
@@ -25,14 +27,14 @@ PHP 4 NEWS
- Fixed bug #30475 (curl_getinfo() may crash in some situations). (Ilia)
- Fixed bug #30442 (segfault when parsing ?getvariable[][ ). (Tony)
- Fixed bug #30388 (rename across filesystems loses ownership and
permission info) (Tony)
permission info). (Tony)
- Fixed bug #30282 (segfault when using unknown/unsupported
session.save_handler and/or session.serialize_handler). (Tony)
- Fixed bug #30281 (Prevent non-wbmp images from being detected as such).
(Ilia)
- Fixed bug #30276 (Possible crash in ctype_digit on large numbers). (Ilia)
- Fixed bug #30229 (imagerectangle and imagefilledrectangle do work well
with alpha channel, corners are drawn twice) (Pierre)
with alpha channel, corners are drawn twice). (Pierre)
- Fixed bug #30224 (Sybase date strings are sometimes not null terminated).
(Ilia)
- Fixed bug #30133 (get_current_user() crashes on Windows). (Edin)
@@ -60,6 +62,7 @@ PHP 4 NEWS
- Fixed funny forking effect in FastCGI when PHP_FCGI_CHILDREN was not set.
- Fixed bug #30050 (Possible crash inside php_shutdown_config()).
(Ilia, nw at softwarekombinat dot de)
- Fixed bug #29954 (array_reduce segfaults when initial value is array). (Tony)
- Fixed bug #29882 (isset crashes on arrays). (Marcus)
- Fixed bug #29753 (mcal_fetch_event() allows 2nd argument to be optional).
(Ilia, Vrana)
@@ -82,7 +85,7 @@ PHP 4 NEWS
- Fixed bug #29226 (ctype_* functions missing validation of numeric string
representations). (Ilia)
- Fixed bug #29209 (imap_fetchbody() doesn't check message index).
(Ilia, tony2001 at phpclub dot net)
(Ilia, Tony)
- Fixed bug #29116 (Zend constant warning uses memory after free).
(Marcus, jdolecek at NetBSD dot org)
- Fixed bug #29114 (Potential double free in php_stat). (Sara)
+51 -10
View File
@@ -301,15 +301,22 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
if (path_length == 0)
return (0);
if (path_length >= MAXPATHLEN)
return (1);
#if !defined(TSRM_WIN32) && !defined(NETWARE)
/* cwd_length can be 0 when getcwd() fails.
* This can happen under solaris when a dir does not have read permissions
* but *does* have execute permissions */
if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) {
if (use_realpath && realpath(path, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
if (use_realpath) {
if (realpath(path, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
} else {
/* disable for now
return 1; */
}
}
} else { /* Concat current directory with relative path and then run realpath() on it */
char *tmp;
@@ -325,9 +332,19 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
memcpy(ptr, path, path_length);
ptr += path_length;
*ptr = '\0';
if (use_realpath && realpath(tmp, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
if (strlen(tmp) >= MAXPATHLEN) {
free(tmp);
return 1;
}
if (use_realpath) {
if (realpath(tmp, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
} else {
/* disable for now
free(tmp);
return 1; */
}
}
free(tmp);
}
@@ -818,13 +835,24 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
{
int command_length;
int dir_length, extra = 0;
char *command_line;
char *ptr;
char *ptr, *dir;
FILE *retval;
command_length = strlen(command);
ptr = command_line = (char *) malloc(command_length + sizeof("cd ; ") + CWDG(cwd).cwd_length+1);
dir_length = CWDG(cwd).cwd_length;
dir = CWDG(cwd).cwd;
while (dir_length > 0) {
if (*dir == '\'') extra+=3;
dir++;
dir_length--;
}
dir_length = CWDG(cwd).cwd_length;
dir = CWDG(cwd).cwd;
ptr = command_line = (char *) malloc(command_length + sizeof("cd '' ; ") + dir_length +1+1);
if (!command_line) {
return NULL;
}
@@ -834,8 +862,21 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
if (CWDG(cwd).cwd_length == 0) {
*ptr++ = DEFAULT_SLASH;
} else {
memcpy(ptr, CWDG(cwd).cwd, CWDG(cwd).cwd_length);
ptr += CWDG(cwd).cwd_length;
*ptr++ = '\'';
while (dir_length > 0) {
switch (*dir) {
case '\'':
*ptr++ = '\'';
*ptr++ = '\\';
*ptr++ = '\'';
/* fall-through */
default:
*ptr++ = *dir;
}
dir++;
dir_length--;
}
*ptr++ = '\'';
}
*ptr++ = ' ';
+9 -6
View File
@@ -20,12 +20,12 @@ AC_DEFUN(PHP_PROG_RE2C,[
AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;])
])
dnl PHP_DEFINE(WHAT[, value])
dnl PHP_DEFINE(WHAT[, value[, directory]])
dnl
dnl Creates builddir/include/what.h and in there #define WHAT value
dnl
AC_DEFUN([PHP_DEFINE],[
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > include/php_]translit($1,A-Z,a-z)[.h]
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
])
dnl PHP_INIT_BUILD_SYSTEM
@@ -1699,16 +1699,19 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=no
unset ICONV_DIR
echo > ext/iconv/php_have_libiconv.h
echo > ext/iconv/php_have_iconv.h
dnl
dnl Check libc first if no path is provided in --with-iconv
dnl
if test "$PHP_ICONV" = "yes"; then
AC_CHECK_FUNC(iconv, [
PHP_DEFINE(HAVE_ICONV)
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
found_iconv=yes
],[
AC_CHECK_FUNC(libiconv,[
PHP_DEFINE(HAVE_LIBICONV)
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
found_iconv=yes
])
])
@@ -1741,11 +1744,11 @@ AC_DEFUN([PHP_SETUP_ICONV], [
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
PHP_DEFINE(HAVE_LIBICONV)
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
], [
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
found_iconv=yes
PHP_DEFINE(HAVE_ICONV)
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
], [], [
-L$ICONV_DIR/lib
])
+2 -2
View File
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=4
MINOR_VERSION=3
RELEASE_VERSION=10
EXTRA_VERSION="RC1"
EXTRA_VERSION="RC2"
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
@@ -919,7 +919,7 @@ fi
if test "$abs_srcdir" != "$abs_builddir"; then
INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
fi
ZEND_EXTRA_LIBS="$LIBS"
-5
View File
@@ -1,5 +0,0 @@
this extension is experimental,
its functions may change their names
or move to extension all together
so do not rely to much on them
you have been warned!
+11 -8
View File
@@ -65,23 +65,26 @@ if test "$PHP_ICONV" != "no"; then
esac
fi
echo > ext/iconv/php_have_bsd_iconv.h
echo > ext/iconv/php_have_glibc_iconv.h
case "$iconv_impl_name" in
gnu_libiconv [)]
PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"])
PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["libiconv"],[Which iconv implementation to use])
;;
bsd [)]
PHP_DEFINE([HAVE_BSD_ICONV],1)
PHP_DEFINE([HAVE_BSD_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_BSD_ICONV],1,[Konstantin Chugeuv's iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"])
PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["BSD iconv"],[Which iconv implementation to use])
;;
glibc [)]
PHP_DEFINE([HAVE_GLIBC_ICONV],1)
PHP_DEFINE([HAVE_GLIBC_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_GLIBC_ICONV],1,[glibc's iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"])
PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["glibc"],[Which iconv implementation to use])
;;
esac
@@ -106,11 +109,11 @@ int main() {
}
],[
AC_MSG_RESULT(yes)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1,[ext/iconv])
AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
],[
AC_MSG_RESULT(no)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
])
@@ -120,7 +123,7 @@ int main() {
#include FOO
], [], [
AC_MSG_RESULT([yes])
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>])
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv])
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
], [
AC_MSG_RESULT([no])
+7 -7
View File
@@ -33,13 +33,13 @@
#endif
#ifdef PHP_ATOM_INC
#include "php_have_iconv.h"
#include "php_have_libiconv.h"
#include "php_have_glibc_iconv.h"
#include "php_have_bsd_iconv.h"
#include "php_iconv_supports_errno.h"
#include "php_php_iconv_impl.h"
#include "php_php_iconv_h_path.h"
#include "ext/iconv/php_have_iconv.h"
#include "ext/iconv/php_have_libiconv.h"
#include "ext/iconv/php_have_glibc_iconv.h"
#include "ext/iconv/php_have_bsd_iconv.h"
#include "ext/iconv/php_iconv_supports_errno.h"
#include "ext/iconv/php_php_iconv_impl.h"
#include "ext/iconv/php_php_iconv_h_path.h"
#endif
-14
View File
@@ -111,13 +111,6 @@ Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DI
See config.log for more information.
])
])
AC_CHECK_LIB(pdf, PDF_load_font, [
AC_MSG_ERROR([
This PDFlib extension only works up to PDFlib 4.0.x.
For newer PDFlib version please use the PECL package:
pecl.php.net/packages/pdflib
])
],[])
;;
*)
if test -f "$PHP_PDFLIB/include/pdflib.h" ; then
@@ -136,13 +129,6 @@ See config.log for more information.
],[
-L$PHP_PDFLIB/lib $PDF_SHARED_LIBADD
])
AC_CHECK_LIB(pdf, PDF_load_font, [
AC_MSG_ERROR([
This PDFlib extension only works up to PDFlib 4.0.x.
For newer PDFlib version please use the PECL package:
pecl.php.net/packages/pdflib
])
],[])
else
AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.])
fi
+1 -1
View File
@@ -316,7 +316,7 @@ PHP_FUNCTION(shmop_write)
RETURN_FALSE;
}
if (offset > shmop->size) {
if (offset < 0 || offset > shmop->size) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "offset out of range");
RETURN_FALSE;
}
+16 -1
View File
@@ -769,7 +769,21 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
return (0);
#ifdef HAVE_AES
} else if (!strcasecmp(prot, "AES128")) {
} else if (!strcasecmp(prot, "AES128")
#ifdef SNMP_VALIDATE_ERR
/*
* In Net-SNMP before 5.2, the following symbols exist:
* usmAES128PrivProtocol, usmAES192PrivProtocol, usmAES256PrivProtocol
* In an effort to be more standards-compliant, 5.2 removed the last two.
* As of 5.2, the symbols are:
* usmAESPrivProtocol, usmAES128PrivProtocol
*
* As we want this extension to compile on both versions, we use the latter
* symbol on purpose, as it's defined to be the same as the former.
*/
|| !strcasecmp(prot, "AES")) {
#else
) {
s->securityPrivProto = usmAES128PrivProtocol;
s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol);
return (0);
@@ -781,6 +795,7 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
s->securityPrivProto = usmAES256PrivProtocol;
s->securityPrivProtoLen = OIDSIZE(usmAES256PrivProtocol);
return (0);
#endif
#endif
} else if (strlen(prot)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid privacy protocol: %s", prot);
+1 -1
View File
@@ -2934,7 +2934,6 @@ PHP_FUNCTION(array_multisort)
array, and the very first argument has to be an array.
*/
for (i = 0; i < argc; i++) {
SEPARATE_ZVAL(args[i]);
if (Z_TYPE_PP(args[i]) == IS_ARRAY) {
/* We see the next array, so we update the sort flags of
the previous array and reset the sort flags. */
@@ -3228,6 +3227,7 @@ PHP_FUNCTION(array_reduce)
efree(callback_name);
if (ZEND_NUM_ARGS() > 2) {
convert_to_long_ex(initial);
result = *initial;
} else {
MAKE_STD_ZVAL(result);
+8
View File
@@ -1198,6 +1198,14 @@ PHP_FUNCTION(popen)
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
p = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
#ifndef PHP_WIN32
{
char *z = memchr(p, 'b', Z_STRLEN_PP(arg2));
if (z) {
memmove(p + (z - p), z + 1, Z_STRLEN_PP(arg2) - (z - p));
}
}
#endif
if (PG(safe_mode)){
b = strchr(Z_STRVAL_PP(arg1), ' ');
if (!b) {
+23 -7
View File
@@ -63,6 +63,13 @@
#include <netinet/in.h>
#endif
#define INC_OUTPUTPOS(a,b) \
if ((a) < 0 || ((INT_MAX - outputpos)/(b)) < (a)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \
RETURN_FALSE; \
} \
outputpos += (a)*(b);
/* Whether machine is little endian */
char machine_little_endian;
@@ -246,7 +253,7 @@ PHP_FUNCTION(pack)
switch ((int) code) {
case 'h':
case 'H':
outputpos += (arg + 1) / 2; /* 4 bit per arg */
INC_OUTPUTPOS((arg + 1) / 2,1) /* 4 bit per arg */
break;
case 'a':
@@ -254,34 +261,34 @@ PHP_FUNCTION(pack)
case 'c':
case 'C':
case 'x':
outputpos += arg; /* 8 bit per arg */
INC_OUTPUTPOS(arg,1) /* 8 bit per arg */
break;
case 's':
case 'S':
case 'n':
case 'v':
outputpos += arg * 2; /* 16 bit per arg */
INC_OUTPUTPOS(arg,2) /* 16 bit per arg */
break;
case 'i':
case 'I':
outputpos += arg * sizeof(int);
INC_OUTPUTPOS(arg,sizeof(int))
break;
case 'l':
case 'L':
case 'N':
case 'V':
outputpos += arg * 4; /* 32 bit per arg */
INC_OUTPUTPOS(arg,4) /* 32 bit per arg */
break;
case 'f':
outputpos += arg * sizeof(float);
INC_OUTPUTPOS(arg,sizeof(float))
break;
case 'd':
outputpos += arg * sizeof(double);
INC_OUTPUTPOS(arg,sizeof(double))
break;
case 'X':
@@ -650,6 +657,11 @@ PHP_FUNCTION(unpack)
sprintf(n, "%.*s", namelen, name);
}
if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow", type);
inputpos = 0;
}
if ((inputpos + size) <= inputlen) {
switch ((int) type) {
case 'a':
@@ -820,6 +832,10 @@ PHP_FUNCTION(unpack)
}
inputpos += size;
if (inputpos < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
inputpos = 0;
}
} else if (arg < 0) {
/* Reached end of input for '*' repeater */
break;
+54
View File
@@ -0,0 +1,54 @@
--TEST--
Bug #30695 (32 bit issues)
--FILE--
<?php
function toUTF8( $char_code )
{
switch ( $char_code )
{
case 0:
$char = chr( 0 );
case !($char_code & 0xffffff80): // 7 bit
$char = chr( $char_code );
break;
case !($char_code & 0xfffff800): // 11 bit
$char = ( chr(0xc0 | (($char_code >> 6) & 0x1f)) .
chr(0x80 | ($char_code & 0x3f)) );
break;
case !($char_code & 0xffff0000): // 16 bit
$char = ( chr(0xe0 | (($char_code >> 12) & 0x0f)) .
chr(0x80 | (($char_code >> 6) & 0x3f)) .
chr(0x80 | ($char_code & 0x3f)) );
break;
case !($char_code & 0xffe00000): // 21 bit
$char = ( chr(0xf0 | (($char_code >> 18) & 0x07)) .
chr(0x80 | (($char_code >> 12) & 0x3f)) .
chr(0x80 | (($char_code >> 6) & 0x3f)) .
chr(0x80 | ($char_code & 0x3f)) );
break;
case !($char_code & 0xfc000000): // 26 bit
$char = ( chr(0xf8 | (($char_code >> 24) & 0x03)) .
chr(0x80 | (($char_code >> 18) & 0x3f)) .
chr(0x80 | (($char_code >> 12) & 0x3f)) .
chr(0x80 | (($char_code >> 6) & 0x3f)) .
chr(0x80 | ($char_code & 0x3f)) );
default: // 31 bit
$char = ( chr(0xfc | (($char_code >> 30) & 0x01)) .
chr(0x80 | (($char_code >> 24) & 0x3f)) .
chr(0x80 | (($char_code >> 18) & 0x3f)) .
chr(0x80 | (($char_code >> 12) & 0x3f)) .
chr(0x80 | (($char_code >> 6) & 0x3f)) .
chr(0x80 | ($char_code & 0x3f)) );
}
return $char;
}
echo "\n", toUTF8(65), "\n", toUTF8(233), "\n", toUTF8(1252), "\n", toUTF8(20095), "\n";
?>
--EXPECT--
A
é
Ӥ
乿
+10 -2
View File
@@ -83,7 +83,7 @@ static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
if (!var_hash) return !SUCCESS;
if (id >= var_hash->used_slots) return !SUCCESS;
if (id < 0 || id >= var_hash->used_slots) return !SUCCESS;
*store = &var_hash->data[id];
@@ -177,7 +177,7 @@ static inline size_t parse_uiv(const unsigned char *p)
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int elements)
{
while (elements-- > 0) {
zval *key, *data;
zval *key, *data, *old_data;
ALLOC_INIT_ZVAL(key);
@@ -205,9 +205,15 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
switch (Z_TYPE_P(key)) {
case IS_LONG:
if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL);
break;
case IS_STRING:
if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
break;
}
@@ -882,6 +888,8 @@ yy86:
return 0;
}
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
zval_ptr_dtor(rval);
}
+10 -2
View File
@@ -81,7 +81,7 @@ static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
if (!var_hash) return !SUCCESS;
if (id >= var_hash->used_slots) return !SUCCESS;
if (id < 0 || id >= var_hash->used_slots) return !SUCCESS;
*store = &var_hash->data[id];
@@ -180,7 +180,7 @@ static inline size_t parse_uiv(const unsigned char *p)
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int elements)
{
while (elements-- > 0) {
zval *key, *data;
zval *key, *data, *old_data;
ALLOC_INIT_ZVAL(key);
@@ -208,9 +208,15 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
switch (Z_TYPE_P(key)) {
case IS_LONG:
if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL);
break;
case IS_STRING:
if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
break;
}
@@ -332,6 +338,8 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
return 0;
}
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
zval_ptr_dtor(rval);
+8
View File
@@ -224,6 +224,14 @@ char *strerror(int);
#define LONG_MIN (- LONG_MAX - 1)
#endif
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
#ifndef INT_MIN
#define INT_MIN (- INT_MAX - 1)
#endif
#define PHP_GCC_VERSION ZEND_GCC_VERSION
#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC
#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT
+2 -2
View File
@@ -3,5 +3,5 @@
#define PHP_MAJOR_VERSION 4
#define PHP_MINOR_VERSION 3
#define PHP_RELEASE_VERSION 10
#define PHP_EXTRA_VERSION "RC1"
#define PHP_VERSION "4.3.10RC1"
#define PHP_EXTRA_VERSION "RC2"
#define PHP_VERSION "4.3.10RC2"
+5 -3
View File
@@ -54,13 +54,15 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
php_stream_wrapper *wrapper = NULL;
TSRMLS_FETCH();
strlcpy(filenamecopy, filename, MAXPATHLEN);
filename=(char *)&filenamecopy;
if (!filename) {
return 0; /* path must be provided */
}
if (strlcpy(filenamecopy, filename, MAXPATHLEN)>=MAXPATHLEN) {
return 0;
}
filename=(char *)&filenamecopy;
if (fopen_mode) {
if (fopen_mode[0] == 'r') {
mode = CHECKUID_DISALLOW_FILE_NOT_EXISTS;
+6 -5
View File
@@ -399,7 +399,7 @@ static apr_status_t php_server_context_cleanup(void *data_)
return APR_SUCCESS;
}
static void php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
{
char *content_type;
char *content_length;
@@ -432,7 +432,7 @@ static void php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
SG(request_info).auth_user = NULL;
SG(request_info).auth_password = NULL;
}
php_request_startup(TSRMLS_C);
return php_request_startup(TSRMLS_C);
}
static void php_apache_request_dtor(request_rec *r TSRMLS_DC)
@@ -511,7 +511,9 @@ zend_first_try {
brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc);
ctx->brigade = brigade;
php_apache_request_ctor(r, ctx TSRMLS_CC);
if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
zend_bailout();
}
} else {
parent_req = ctx->r;
ctx->r = r;
@@ -544,9 +546,8 @@ zend_first_try {
#if MEMORY_LIMIT
{
char *mem_usage;
mem_usage = apr_psprintf(ctx->r->pool, "%u", AG(allocated_memory_peak));
AG(allocated_memory_peak) = 0;
apr_table_set(r->notes, "mod_php_memory_usage", mem_usage);
}
#endif
+2 -2
View File
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php4pi3web_EXPORTS" /YX /FD /GZ /c
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP4PI3WEB_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP4PI3WEB_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php4pi3web_EXPORTS" /YX /FD /c
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP4PI3WEB_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP4PI3WEB_EXPORTS" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+31 -77
View File
@@ -25,7 +25,6 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "pi3web_sapi.h"
#include "php.h"
#include "php_main.h"
#include "php_variables.h"
@@ -40,40 +39,20 @@
#include "PiAPI.h"
#include "Pi3API.h"
#include "pi3web_sapi.h"
#define PI3WEB_SERVER_VAR_BUF_SIZE 1024
int IWasLoaded=0;
static char *pi3web_server_variables[] = {
"ALL_HTTP",
"AUTH_TYPE",
"CONTENT_LENGTH",
"CONTENT_TYPE",
"GATEWAY_INTERFACE",
"PATH_INFO",
"PATH_TRANSLATED",
"QUERY_STRING",
"REQUEST_METHOD",
"REMOTE_ADDR",
"REMOTE_HOST",
"REMOTE_USER",
"SCRIPT_NAME",
"SERVER_NAME",
"SERVER_PORT",
"SERVER_PROTOCOL",
"SERVER_SOFTWARE",
NULL
};
static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS)
{
char **p = pi3web_server_variables;
char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE];
DWORD variable_len;
LPCONTROL_BLOCK lpCB;
lpCB = (LPCONTROL_BLOCK) SG(server_context);
LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context);
PIDB *pDB = (PIDB *)lpCB->GetVariableNames(lpCB->ConnID);
PIDBIterator *pIter = PIDB_getIterator( pDB, PIDBTYPE_STRING, 0, 0 );
PUTS("<table border=0 cellpadding=3 cellspacing=1 width=600 align=center>\n");
PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">Pi3Web Server Information</th></tr>\n");
@@ -99,22 +78,28 @@ static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS)
php_info_print_table_row(2, "HTTP Request Line", lpCB->lpszReq);
PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">HTTP Headers</th></tr>\n");
php_info_print_table_header(2, "Server Variable", "Value");
while (*p) {
/* --- loop over all registered server variables --- */
for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) )
{
PCHAR pKey;
PIDBIterator_current( pIter, &pKey );
if ( !pKey ) { /* sanity */ continue; };
variable_len = PI3WEB_SERVER_VAR_BUF_SIZE;
if (lpCB->GetServerVariable(lpCB->ConnID, *p, variable_buf, &variable_len)
if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len)
&& variable_buf[0]) {
php_info_print_table_row(2, *p, variable_buf);
php_info_print_table_row(2, pKey, variable_buf);
} else if (PIPlatform_getLastError() == PIAPI_EINVAL) {
char *tmp_variable_buf;
tmp_variable_buf = (char *) emalloc(variable_len);
if (lpCB->GetServerVariable(lpCB->ConnID, *p, tmp_variable_buf, &variable_len)
if (lpCB->GetServerVariable(lpCB->ConnID, pKey, tmp_variable_buf, &variable_len)
&& variable_buf[0]) {
php_info_print_table_row(2, *p, tmp_variable_buf);
php_info_print_table_row(2, pKey, tmp_variable_buf);
}
efree(tmp_variable_buf);
}
p++;
}
PUTS("</table>");
@@ -297,26 +282,29 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC)
char static_variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE];
char *variable_buf;
DWORD variable_len = PI3WEB_SERVER_VAR_BUF_SIZE;
char *variable;
char *strtok_buf = NULL;
LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context);
char **p = pi3web_server_variables;
p++; // Jump over ALL_HTTP;
PIDB *pDB = (PIDB *)lpCB->GetVariableNames(lpCB->ConnID);
PIDBIterator *pIter = PIDB_getIterator( pDB, PIDBTYPE_STRING, 0, 0 );
/* --- loop over all registered server variables --- */
for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) )
{
PCHAR pKey;
PIDBIterator_current( pIter, &pKey );
if ( !pKey ) { /* sanity */ continue; };
/* Register the standard server variables */
while (*p) {
variable_len = PI3WEB_SERVER_VAR_BUF_SIZE;
if (lpCB->GetServerVariable(lpCB->ConnID, *p, static_variable_buf, &variable_len)
if (lpCB->GetServerVariable(lpCB->ConnID, pKey, static_variable_buf, &variable_len)
&& (variable_len > 1)) {
php_register_variable(*p, static_variable_buf, track_vars_array TSRMLS_CC);
php_register_variable(pKey, static_variable_buf, track_vars_array TSRMLS_CC);
} else if (PIPlatform_getLastError()==PIAPI_EINVAL) {
variable_buf = (char *) emalloc(variable_len);
if (lpCB->GetServerVariable(lpCB->ConnID, *p, variable_buf, &variable_len)) {
php_register_variable(*p, variable_buf, track_vars_array TSRMLS_CC);
if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len)) {
php_register_variable(pKey, variable_buf, track_vars_array TSRMLS_CC);
}
efree(variable_buf);
}
p++;
}
/* PHP_SELF support */
@@ -325,40 +313,6 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC)
&& (variable_len > 1)) {
php_register_variable("PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC);
}
variable_len = PI3WEB_SERVER_VAR_BUF_SIZE;
if (lpCB->GetServerVariable(lpCB->ConnID, "ALL_HTTP", static_variable_buf, &variable_len)
&& (variable_len > 1)) {
variable_buf = static_variable_buf;
} else {
if (PIPlatform_getLastError()==PIAPI_EINVAL) {
variable_buf = (char *) emalloc(variable_len);
if (!lpCB->GetServerVariable(lpCB->ConnID, "ALL_HTTP", variable_buf, &variable_len)) {
efree(variable_buf);
return;
}
} else {
return;
}
}
variable = php_strtok_r(variable_buf, "\r\n", &strtok_buf);
while (variable) {
char *colon = strchr(variable, ':');
if (colon) {
char *value = colon+1;
while (*value==' ') {
value++;
}
*colon = 0;
php_register_variable(variable, value, track_vars_array TSRMLS_CC);
*colon = ':';
}
variable = php_strtok_r(NULL, "\r\n", &strtok_buf);
}
if (variable_buf!=static_variable_buf) {
efree(variable_buf);
}
}
static sapi_module_struct pi3web_sapi_module = {
+7 -5
View File
@@ -3,7 +3,6 @@
#ifdef PHP_WIN32
# include <windows.h>
# include <httpext.h>
# ifdef PHP4PI3WEB_EXPORTS
# define MODULE_API __declspec(dllexport)
# else
@@ -15,7 +14,6 @@
typedef int BOOL;
typedef void far *LPVOID;
typedef LPVOID HCONN;
typedef unsigned long DWORD;
typedef DWORD far *LPDWORD;
typedef char CHAR;
@@ -24,6 +22,8 @@
typedef BYTE far *LPBYTE;
#endif
typedef LPVOID HCONN;
#ifdef __cplusplus
extern "C" {
#endif
@@ -59,17 +59,19 @@ typedef struct _CONTROL_BLOCK {
LPSTR lpszContentType; // Content type of client data
DWORD dwBehavior; // PHP behavior (standard, highlight, intend
LPVOID (* GetVariableNames) (HCONN hConn);
BOOL (* GetServerVariable) ( HCONN hConn,
LPSTR lpszVariableName,
LPVOID lpvBuffer,
LPDWORD lpdwSize );
BOOL (* WriteClient) ( HCONN ConnID,
LPVOID Buffer,
BOOL (* WriteClient) ( HCONN hConn,
LPVOID lpvBuffer,
LPDWORD lpdwBytes,
DWORD dwReserved );
BOOL (* ReadClient) ( HCONN ConnID,
BOOL (* ReadClient) ( HCONN hConn,
LPVOID lpvBuffer,
LPDWORD lpdwSize );