ID: 20268 Comment by: ddhill at zk3 dot dec dot com Reported By: bdabney at dallasnews dot com Status: Open Bug Type: Zend Engine 2 problem Operating System: Solaris 9 PHP Version: 4CVS-2002-11-05 New Comment:
Forgot to mention - bug 21822 has the same root cause as this one. Previous Comments: ------------------------------------------------------------------------ [2003-02-21 10:15:39] ddhill at zk3 dot dec dot com I am glad to see someone is looking at the OnUpDateInt issue, and I think adding an OnUpdateLong is a good way to go. On Tru64 the int* vs. long* can cause some really hard to track errors because if the storage area is an int and is treated as a long, 32 bits of data following the int gets scrubbed with apparently no reason. I dug through a bunch of the 4.3.1 code and there is quite a mix of int an long being passed to OnUpdateInt, either directly or indirectly as in the case of zlib (which is where I encountered it). Blindly changeing OnUpdateInt to use int* will not work as there are quite a few longs being passed into the routine. The right answer seems to be adding OnUpdateLong and then doing a code sweep of the core and extensions to make sure the right one is called, which seems to be the thrust of the previous response. I hope these changes will show up in the mainstream soon. thanks! ------------------------------------------------------------------------ [2002-11-09 21:54:25] j-devenish at users dot sourceforge dot net Oops, looks like I didn't paste my grumbles about fdf.c and zend_parse_parameters. Index: Zend/zend_ini.c =================================================================== RCS file: /repository/Zend/zend_ini.c,v retrieving revision 1.23 diff -u -r1.23 zend_ini.c --- Zend/zend_ini.c 23 Sep 2002 12:00:39 -0000 1.23 +++ Zend/zend_ini.c 10 Nov 2002 03:46:13 -0000 @@ -430,6 +430,23 @@ ZEND_API ZEND_INI_MH(OnUpdateInt) { + int *p; +#ifndef ZTS + char *base = (char *) mh_arg2; +#else + char *base; + + base = (char *) ts_resource(*((int *) mh_arg2)); +#endif + + p = (int *) (base+(size_t) mh_arg1); + + *p = zend_atoi(new_value, new_value_length); + return SUCCESS; +} + +ZEND_API ZEND_INI_MH(OnUpdateLong) +{ long *p; #ifndef ZTS char *base = (char *) mh_arg2; Index: Zend/zend_ini.h =================================================================== RCS file: /repository/Zend/zend_ini.h,v retrieving revision 1.21 diff -u -r1.21 zend_ini.h --- Zend/zend_ini.h 28 Aug 2002 13:19:30 -0000 1.21 +++ Zend/zend_ini.h 10 Nov 2002 03:46:13 -0000 @@ -171,6 +171,7 @@ /* Standard message handlers */ ZEND_API ZEND_INI_MH(OnUpdateBool); ZEND_API ZEND_INI_MH(OnUpdateInt); +ZEND_API ZEND_INI_MH(OnUpdateLong); ZEND_API ZEND_INI_MH(OnUpdateReal); ZEND_API ZEND_INI_MH(OnUpdateString); ZEND_API ZEND_INI_MH(OnUpdateStringUnempty); Index: ext/bz2/bz2.c =================================================================== RCS file: /repository/php4/ext/bz2/bz2.c,v retrieving revision 1.61 diff -u -r1.61 bz2.c --- ext/bz2/bz2.c 5 Oct 2002 16:26:57 -0000 1.61 +++ ext/bz2/bz2.c 10 Nov 2002 03:46:13 -0000 @@ -253,7 +253,7 @@ PHP_FUNCTION(bzread) { zval *bz; - int len = 1024; + long len = 1024; php_stream *stream; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) { Index: ext/dio/dio.c =================================================================== RCS file: /repository/php4/ext/dio/dio.c,v retrieving revision 1.21 diff -u -r1.21 dio.c --- ext/dio/dio.c 3 Nov 2002 13:22:49 -0000 1.21 +++ ext/dio/dio.c 10 Nov 2002 03:46:13 -0000 @@ -144,7 +144,7 @@ php_fd_t *f; char *file_name; int file_name_length; - int flags; + long flags; mode_t mode = 0; int fd; @@ -176,7 +176,7 @@ zval *r_fd; php_fd_t *f; char *data; - int bytes = 1024; + long bytes = 1024; ssize_t res; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) { Index: ext/domxml/php_domxml.c =================================================================== RCS file: /repository/php4/ext/domxml/php_domxml.c,v retrieving revision 1.218 diff -u -r1.218 php_domxml.c --- ext/domxml/php_domxml.c 1 Nov 2002 10:06:10 -0000 1.218 +++ ext/domxml/php_domxml.c 10 Nov 2002 03:46:14 -0000 @@ -2042,7 +2042,8 @@ zval *rv = NULL; zval *id; xmlNode *n, *node; - int ret, recursive = 0;; + int ret; + long recursive = 0; DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep); Index: ext/fdf/fdf.c =================================================================== RCS file: /repository/php4/ext/fdf/fdf.c,v retrieving revision 1.66 diff -u -r1.66 fdf.c --- ext/fdf/fdf.c 23 Oct 2002 01:11:06 -0000 1.66 +++ ext/fdf/fdf.c 10 Nov 2002 03:46:14 -0000 @@ -554,7 +554,8 @@ PHP_FUNCTION(fdf_get_ap) { zval *r_fdf; char *fieldname, *filename; - int fieldname_len, filename_len, face; + int fieldname_len, filename_len; + long face; FDFDoc fdf; FDFErc err; FDFAppFace facenr; @@ -941,7 +942,8 @@ PHP_FUNCTION(fdf_get_flags) { zval *r_fdf; char *fieldname; - int fieldname_len, whichflags; + int fieldname_len; + long whichflags; FDFDoc fdf; FDFErc err; ASUns32 flags; @@ -997,7 +999,8 @@ PHP_FUNCTION(fdf_get_opt) { zval *r_fdf; char *fieldname; - int fieldname_len, element = -1; + int fieldname_len; + long element = -1; FDFDoc fdf; FDFErc err; @@ -1410,12 +1413,12 @@ PHP_FUNCTION(fdf_remove_item) { zval *r_fdf; char *fieldname; - int fieldname_len; + long fieldname_len; long item; FDFDoc fdf; FDFErc err; - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &r_fdf, + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &r_fdf, &fieldname, &fieldname_len ) == FAILURE) { Index: ext/ftp/php_ftp.c =================================================================== RCS file: /repository/php4/ext/ftp/php_ftp.c,v retrieving revision 1.74 diff -u -r1.74 php_ftp.c --- ext/ftp/php_ftp.c 3 Oct 2002 11:33:05 -0000 1.74 +++ ext/ftp/php_ftp.c 10 Nov 2002 03:46:14 -0000 @@ -145,7 +145,8 @@ { ftpbuf_t *ftp; char *host; - int host_len, port = 0; + int host_len; + long port = 0; long timeout_sec = FTP_DEFAULT_TIMEOUT; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { @@ -181,7 +182,8 @@ { ftpbuf_t *ftp; char *host; - int host_len, port = 0; + int host_len; + long port = 0; long timeout_sec = FTP_DEFAULT_TIMEOUT; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { @@ -468,7 +470,8 @@ ftptype_t xtype; php_stream *stream; char *file; - int file_len, mode, resumepos=0; + int file_len; + long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { return; @@ -511,7 +514,8 @@ ftptype_t xtype; php_stream *stream; char *file; - int file_len, mode, resumepos=0, ret; + int file_len, mode; + long resumepos=0, ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { return; @@ -580,7 +584,8 @@ ftptype_t xtype; php_stream *outstream; char *local, *remote; - int local_len, remote_len, mode, resumepos=0; + int local_len, remote_len; + long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) { return; @@ -636,7 +641,8 @@ ftptype_t xtype; php_stream *outstream; char *local, *remote; - int local_len, remote_len, mode, resumepos=0, ret; + int local_len, remote_len, ret; + long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) { return; @@ -735,7 +741,8 @@ zval *z_ftp, *z_file; ftpbuf_t *ftp; ftptype_t xtype; - int mode, remote_len, startpos=0; + int remote_len; + long mode, startpos=0; php_stream *stream; char *remote; @@ -781,7 +788,8 @@ zval *z_ftp, *z_file; ftpbuf_t *ftp; ftptype_t xtype; - int mode, remote_len, startpos=0, ret; + int remote_len, ret; + long mode, startpos=0; php_stream *stream; char *remote; @@ -833,7 +841,8 @@ ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; - int remote_len, local_len, mode, startpos=0; + int remote_len, local_len; + long mode, startpos=0; php_stream * instream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { @@ -887,7 +896,8 @@ ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; - int remote_len, local_len, mode, startpos=0, ret; + int remote_len, local_len, ret; + long mode, startpos=0; php_stream * instream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { Index: ext/iconv/iconv.c =================================================================== RCS file: /repository/php4/ext/iconv/iconv.c,v retrieving revision 1.63 diff -u -r1.63 iconv.c --- ext/iconv/iconv.c 6 Nov 2002 16:54:18 -0000 1.63 +++ ext/iconv/iconv.c 10 Nov 2002 03:46:14 -0000 @@ -383,7 +383,8 @@ char *out_buffer, *content_type, *mimetype = NULL, *s; zval *zv_string; unsigned int out_len; - int status, mimetype_alloced = 0; + long status; + int mimetype_alloced = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &zv_string, &status) == FAILURE) return; Index: ext/ldap/ldap.c =================================================================== RCS file: /repository/php4/ext/ldap/ldap.c,v retrieving revision 1.130 diff -u -r1.130 ldap.c --- ext/ldap/ldap.c 5 Nov 2002 14:18:20 -0000 1.130 +++ ext/ldap/ldap.c 10 Nov 2002 03:46:14 -0000 @@ -200,7 +200,7 @@ /* {{{ PHP_INI_BEGIN */ PHP_INI_BEGIN() - STD_PHP_INI_ENTRY_EX("ldap.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, zend_ldap_globals, ldap_globals, display_link_numbers) + STD_PHP_INI_ENTRY_EX("ldap.max_links", "-1", PHP_INI_SYSTEM, + OnUpdateLong, max_links, zend_ldap_globals, + ldap_globals, display_link_numbers) PHP_INI_END() /* }}} */ @@ -288,7 +288,7 @@ php_info_print_table_row(2, "LDAP Support", "enabled" ); php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.130 2002/11/05 14:18:20 edink Exp $" ); - if (LDAPG(max_links) == -1) { + if (LDAPG(max_links) < 0) { snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links)); } else { snprintf(tmp, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links)); @@ -345,11 +345,11 @@ { char *host = NULL; int hostlen; - int port = 389; /* Default port */ + long port = 389; /* Default port */ #ifdef HAVE_ORALDAP char *wallet, *walletpasswd; int walletlen, walletpasswdlen; - int authmode; + long authmode; int ssl=0; #endif ldap_linkdata *ld; @@ -373,7 +373,7 @@ } #endif - if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) { + if (LDAPG(max_links) > -1 && LDAPG(num_links) >= LDAPG(max_links)) { php_error(E_WARNING, "%s(): Too many open links (%d)", get_active_function_name(TSRMLS_C), LDAPG(num_links)); RETURN_FALSE; } Index: ext/mbstring/mbstring.c =================================================================== RCS file: /repository/php4/ext/mbstring/mbstring.c,v retrieving revision 1.128 diff -u -r1.128 mbstring.c --- ext/mbstring/mbstring.c 3 Nov 2002 08:50:43 -0000 1.128 +++ ext/mbstring/mbstring.c 10 Nov 2002 03:46:14 -0000 @@ -2568,7 +2568,7 @@ PHP_FUNCTION(mb_convert_case) { char *str, *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding)); - long str_len, from_encoding_len; + int str_len, from_encoding_len; long case_mode = 0; char *newstr; size_t ret_len; @@ -2592,7 +2592,7 @@ PHP_FUNCTION(mb_strtoupper) { char *str, *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding)); - long str_len, from_encoding_len; + int str_len, from_encoding_len; char *newstr; size_t ret_len; @@ -2615,7 +2615,7 @@ PHP_FUNCTION(mb_strtolower) { char *str, *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding)); - long str_len, from_encoding_len; + int str_len, from_encoding_len; char *newstr; size_t ret_len; Index: ext/mbstring/php_mbregex.c =================================================================== RCS file: /repository/php4/ext/mbstring/php_mbregex.c,v retrieving revision 1.18 diff -u -r1.18 php_mbregex.c --- ext/mbstring/php_mbregex.c 2 Nov 2002 13:38:32 -0000 1.18 +++ ext/mbstring/php_mbregex.c 10 Nov 2002 03:46:14 -0000 @@ -595,7 +595,8 @@ mb_regex_t re; struct mbre_registers regs = {0, 0, 0, 0}; char *string; - int n, err, count, string_len, pos; + int n, err, string_len, pos; + long count; count = -1; Index: ext/mysql/php_mysql.c =================================================================== RCS file: /repository/php4/ext/mysql/php_mysql.c,v retrieving revision 1.169 diff -u -r1.169 php_mysql.c --- ext/mysql/php_mysql.c 24 Oct 2002 13:14:39 -0000 1.169 +++ ext/mysql/php_mysql.c 10 Nov 2002 03:46:14 -0000 @@ -349,15 +349,15 @@ /* {{{ PHP_INI */ PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("mysql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, zend_mysql_globals, mysql_globals) - STD_PHP_INI_ENTRY_EX("mysql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_persistent, zend_mysql_globals, mysql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mysql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, zend_mysql_globals, mysql_globals, display_link_numbers) + STD_PHP_INI_BOOLEAN("mysql.allow_persistent", "1", PHP_INI_SYSTEM, + OnUpdateLong, allow_persistent, zend_mysql_globals, +mysql_globals) + STD_PHP_INI_ENTRY_EX("mysql.max_persistent", "-1", PHP_INI_SYSTEM, + OnUpdateLong, max_persistent, zend_mysql_globals, +mysql_globals, display_link_numbers) + STD_PHP_INI_ENTRY_EX("mysql.max_links", "-1", +PHP_INI_SYSTEM, OnUpdateLong, max_links, +zend_mysql_globals, mysql_globals, display_link_numbers) STD_PHP_INI_ENTRY("mysql.default_host", NULL, PHP_INI_ALL, OnUpdateString, default_host, zend_mysql_globals, mysql_globals) STD_PHP_INI_ENTRY("mysql.default_user", NULL, PHP_INI_ALL, OnUpdateString, default_user, zend_mysql_globals, mysql_globals) STD_PHP_INI_ENTRY("mysql.default_password", NULL, PHP_INI_ALL, OnUpdateString, default_password, zend_mysql_globals, mysql_globals) PHP_INI_ENTRY("mysql.default_port", NULL, PHP_INI_ALL, OnMySQLPort) STD_PHP_INI_ENTRY("mysql.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysql_globals, mysql_globals) - STD_PHP_INI_ENTRY_EX("mysql.connect_timeout", "-1", PHP_INI_SYSTEM, OnUpdateInt, connect_timeout, zend_mysql_globals, mysql_globals, display_link_numbers) + STD_PHP_INI_ENTRY_EX("mysql.connect_timeout", "-1", PHP_INI_SYSTEM, + OnUpdateLong, connect_timeout, zend_mysql_globals, mysql_globals, display_link_numbers) PHP_INI_END() /* }}} */ Index: ext/openssl/openssl.c =================================================================== RCS file: /repository/php4/ext/openssl/openssl.c,v retrieving revision 1.51 diff -u -r1.51 openssl.c --- ext/openssl/openssl.c 10 Aug 2002 20:19:46 -0000 1.51 +++ ext/openssl/openssl.c 10 Nov 2002 03:46:14 -0000 @@ -692,7 +692,7 @@ BIO * bio_out; long certresource; char * filename; - long filename_len; + int filename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &zcert, &filename, &filename_len, ¬ext) == FAILURE) return; @@ -972,7 +972,7 @@ STACK_OF(X509) * untrustedchain = NULL; long purpose; char * untrusted = NULL; - long untrusted_len; + int untrusted_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) @@ -1305,7 +1305,7 @@ X509_REQ * csr; zval * zcsr = NULL; zend_bool notext = 1; - char * filename = NULL; long filename_len; + char * filename = NULL; int filename_len; BIO * bio_out; long csr_resource; @@ -1774,8 +1774,8 @@ { struct php_x509_request req; zval * zpkey, * args = NULL; - char * passphrase = NULL; long passphrase_len = 0; - char * filename = NULL; long filename_len = 0; + char * passphrase = NULL; int passphrase_len = 0; + char * filename = NULL; int filename_len = 0; long key_resource = -1; EVP_PKEY * key; BIO * bio_out = NULL; @@ -1826,7 +1826,7 @@ { struct php_x509_request req; zval * zpkey, * args = NULL, *out; - char * passphrase = NULL; long passphrase_len = 0; + char * passphrase = NULL; int passphrase_len = 0; long key_resource = -1; EVP_PKEY * key; BIO * bio_out = NULL; @@ -1918,7 +1918,7 @@ zval *cert; EVP_PKEY *pkey; char * passphrase = ""; - long passphrase_len; + int passphrase_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) return; @@ -1948,9 +1948,9 @@ PKCS7 * p7 = NULL; BIO * in = NULL, * datain = NULL; long flags = 0; - char * filename; long filename_len; - char * extracerts = NULL; long extracerts_len; - char * signersfilename = NULL; long signersfilename_len; + char * filename; int filename_len; + char * extracerts = NULL; int extracerts_len; + char * signersfilename = NULL; int signersfilename_len; RETVAL_LONG(-1); @@ -2037,8 +2037,8 @@ uint strindexlen; ulong intindex; char * strindex; - char * infilename = NULL; long infilename_len; - char * outfilename = NULL; long outfilename_len; + char * infilename = NULL; int infilename_len; + char * outfilename = NULL; int outfilename_len; RETVAL_FALSE; @@ -2159,9 +2159,9 @@ uint strindexlen; HashPosition hpos; char * strindex; - char * infilename; long infilename_len; - char * outfilename; long outfilename_len; - char * extracertsfilename = NULL; long extracertsfilename_len; + char * infilename; int infilename_len; + char * outfilename; int outfilename_len; + char * extracertsfilename = NULL; int extracertsfilename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sszza!|ls", &infilename, &infilename_len, &outfilename, &outfilename_len, @@ -2255,8 +2255,8 @@ long certresval, keyresval; BIO * in = NULL, * out = NULL, * datain = NULL; PKCS7 * p7 = NULL; - char * infilename; long infilename_len; - char * outfilename; long outfilename_len; + char * infilename; int infilename_len; + char * outfilename; int outfilename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz|z", &infilename, &infilename_len, &outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) @@ -2318,7 +2318,8 @@ int successful = 0; long keyresource = -1; char * data; - long data_len, padding = RSA_PKCS1_PADDING; + int data_len; + long padding = RSA_PKCS1_PADDING; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) return; @@ -2376,7 +2377,7 @@ long padding = RSA_PKCS1_PADDING; long keyresource = -1; char * data; - long data_len; + int data_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) return; @@ -2440,7 +2441,7 @@ long keyresource = -1; long padding = RSA_PKCS1_PADDING; char * data; - long data_len; + int data_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) return; @@ -2498,7 +2499,7 @@ long keyresource = -1; long padding = RSA_PKCS1_PADDING; char * data; - long data_len; + int data_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) return; @@ -2584,7 +2585,7 @@ int siglen; unsigned char *sigbuf; long keyresource = -1; - char * data; long data_len; + char * data; int data_len; EVP_MD_CTX md_ctx; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz", &data, &data_len, &signature, &key) == FAILURE) @@ -2624,8 +2625,8 @@ int err; EVP_MD_CTX md_ctx; long keyresource = -1; - char * data; long data_len; - char * signature; long signature_len; + char * data; int data_len; + char * signature; int signature_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz", &data, &data_len, &signature, &signature_len, &key) == FAILURE) @@ -2659,7 +2660,7 @@ long * key_resources; /* so we know what to cleanup */ int i, len1, len2, *eksl, nkeys; unsigned char *buf = NULL, **eks; - char * data; long data_len; + char * data; int data_len; EVP_CIPHER_CTX ctx; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szza/", @@ -2787,8 +2788,8 @@ unsigned char *buf; long keyresource = -1; EVP_CIPHER_CTX ctx; - char * data; long data_len; - char * ekey; long ekey_len; + char * data; int data_len; + char * ekey; int ekey_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szsz", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey) == FAILURE) Index: ext/sockets/sockets.c =================================================================== RCS file: /repository/php4/ext/sockets/sockets.c,v retrieving revision 1.125 diff -u -r1.125 sockets.c --- ext/sockets/sockets.c 28 Oct 2002 03:05:04 -0000 1.125 +++ ext/sockets/sockets.c 10 Nov 2002 03:46:15 -0000 @@ -555,7 +555,8 @@ struct timeval *tv_p = NULL; fd_set rfds, wfds, efds; SOCKET max_fd = 0; - int retval, sets = 0, usec = 0; + int retval, sets = 0; + long usec = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) return; @@ -602,7 +603,7 @@ PHP_FUNCTION(socket_create_listen) { php_socket *php_sock; - int port, backlog = 128; + long port, backlog = 128; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &port, &backlog) == FAILURE) return; @@ -702,7 +703,7 @@ { zval *arg1; php_socket *php_sock; - int backlog = 0; + long backlog = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &backlog) == FAILURE) return; @@ -739,7 +740,8 @@ { zval *arg1; php_socket *php_sock; - int retval, str_len, length; + int retval, str_len; + long length; char *str; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE) @@ -776,7 +778,8 @@ php_socket *php_sock; read_func read_function = (read_func) recv; char *tmpbuf; - int retval, length, type = PHP_BINARY_READ; + int retval; + long length, type = PHP_BINARY_READ; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &length, &type) == FAILURE) return; @@ -922,7 +925,7 @@ Creates an endpoint for communication in the domain specified by domain, of type specified by type */ PHP_FUNCTION(socket_create) { - int arg1, arg2, arg3; + long arg1, arg2, arg3; php_socket *php_sock = (php_socket*)emalloc(sizeof(php_socket)); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &arg1, &arg2, &arg3) == FAILURE) { @@ -964,7 +967,8 @@ struct sockaddr_in sin; struct sockaddr_un s_un; char *addr; - int retval, addr_len, port; + int retval, addr_len; + long port; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) return; @@ -1014,7 +1018,7 @@ Returns a string describing an error */ PHP_FUNCTION(socket_strerror) { - int arg1; + long arg1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg1) == FAILURE) return; @@ -1032,7 +1036,8 @@ struct sockaddr *sock_type = (struct sockaddr*) &sa_storage; php_socket *php_sock; char *addr; - int addr_len, port = 0; + int addr_len; + long port = 0; long retval = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) @@ -1129,7 +1134,7 @@ { zval *iovec_id; php_iovec_t *vector; - unsigned int iovec_position; + unsigned long iovec_position; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &iovec_id, &iovec_position) == FAILURE) return; @@ -1152,7 +1157,7 @@ zval *iovec_id; php_iovec_t *vector; int new_val_len; - unsigned int iovec_position; + unsigned long iovec_position; char *new_val; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &iovec_id, &iovec_position, &new_val, &new_val_len) == FAILURE) @@ -1183,7 +1188,7 @@ zval *iovec_id; php_iovec_t *vector; struct iovec *vector_array; - int iov_len; + long iov_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &iovec_id, &iov_len) == FAILURE) return; @@ -1311,7 +1316,8 @@ zval *php_sock_res, *buf; char *recv_buf; php_socket *php_sock; - int retval, len, flags; + int retval; + long len, flags; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzll", &php_sock_res, &buf, &len, &flags) == FAILURE) return; @@ -1352,7 +1358,8 @@ { zval *arg1; php_socket *php_sock; - int buf_len, len, flags, retval; + int buf_len, retval; + long len, flags; char *buf; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE) @@ -1380,7 +1387,8 @@ struct sockaddr_un s_un; struct sockaddr_in sin; socklen_t slen; - int retval, arg3, arg4; + int retval; + long arg3, arg4; char *recv_buf, *address; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzllz|z", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) @@ -1456,7 +1464,8 @@ php_socket *php_sock; struct sockaddr_un s_un; struct sockaddr_in sin; - int retval, buf_len, len, flags, addr_len, port = 0; + int retval, buf_len, addr_len; + long len, flags, port = 0; char *buf, *addr; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE) @@ -1664,7 +1673,8 @@ struct sockaddr sa; char *addr; socklen_t salen; - int flags, addr_len, port; + int addr_len; + long flags, port; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrls|l", &arg1, &arg2, &flags, &addr, &addr_len, &port) == FAILURE) return; @@ -1749,7 +1759,8 @@ struct timeval tv; socklen_t optlen; php_socket *php_sock; - int other_val, level, optname; + int other_val; + long level, optname; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1, &level, &optname) == FAILURE) return; @@ -1812,7 +1823,8 @@ struct linger lv; struct timeval tv; php_socket *php_sock; - int ov, optlen, retval, level, optname; + int ov, optlen, retval; + long level, optname; void *opt_ptr; HashTable *opt_ht; @@ -1904,7 +1916,7 @@ zval *retval[2], *fds_array_zval; php_socket *php_sock[2]; SOCKET fds_array[2]; - int domain, type, protocol; + long domain, type, protocol; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllz", &domain, &type, &protocol, &fds_array_zval) == FAILURE) return; @@ -1961,7 +1973,7 @@ PHP_FUNCTION(socket_shutdown) { zval *arg1; - int how_shutdown = 2; + long how_shutdown = 2; php_socket *php_sock; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &how_shutdown) == FAILURE) Index: ext/standard/fsock.c =================================================================== RCS file: /repository/php4/ext/standard/fsock.c,v retrieving revision 1.106 diff -u -r1.106 fsock.c --- ext/standard/fsock.c 24 Oct 2002 13:14:42 -0000 1.106 +++ ext/standard/fsock.c 10 Nov 2002 03:46:15 -0000 @@ -136,7 +136,7 @@ { char *host; int host_len; - int port = -1; + long port = -1; zval *zerrno = NULL, *zerrstr = NULL; double timeout = FG(default_socket_timeout); unsigned long conv; Index: ext/standard/html.c =================================================================== RCS file: /repository/php4/ext/standard/html.c,v retrieving revision 1.61 diff -u -r1.61 html.c --- ext/standard/html.c 29 Oct 2002 15:05:07 -0000 1.61 +++ ext/standard/html.c 10 Nov 2002 03:46:15 -0000 @@ -818,7 +818,8 @@ { char *str, *hint_charset = NULL; int str_len, hint_charset_len = 0; - int len, quote_style = ENT_COMPAT; + int len; + long quote_style = ENT_COMPAT; char *replaced; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, @@ -859,7 +860,8 @@ PHP_FUNCTION(html_entity_decode) { char *str, *hint_charset = NULL; - int str_len, hint_charset_len, len, quote_style = ENT_COMPAT; + int str_len, hint_charset_len, len; + long quote_style = ENT_COMPAT; char *replaced; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, @@ -885,7 +887,7 @@ Returns the internal translation table used by htmlspecialchars and htmlentities */ PHP_FUNCTION(get_html_translation_table) { - int which = HTML_SPECIALCHARS, quote_style = ENT_COMPAT; + long which = HTML_SPECIALCHARS, quote_style = ENT_COMPAT; int i, j; char ind[2]; enum entity_charset charset = determine_charset(NULL TSRMLS_CC); Index: ext/standard/metaphone.c =================================================================== RCS file: /repository/php4/ext/standard/metaphone.c,v retrieving revision 1.21 diff -u -r1.21 metaphone.c --- ext/standard/metaphone.c 20 Mar 2002 08:17:06 -0000 1.21 +++ ext/standard/metaphone.c 10 Nov 2002 03:46:15 -0000 @@ -35,7 +35,8 @@ { char *str; char *result = 0; - int phones = 0, str_len; + long phones = 0; + int str_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &phones) == FAILURE) { Index: ext/standard/string.c =================================================================== RCS file: /repository/php4/ext/standard/string.c,v retrieving revision 1.333 diff -u -r1.333 string.c --- ext/standard/string.c 5 Nov 2002 13:52:11 -0000 1.333 +++ ext/standard/string.c 10 Nov 2002 03:46:15 -0000 @@ -202,7 +202,8 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) { char *s11, *s22; - long len1, len2, start, len; + int len1, len2; + long start, len; start = 0; len = 0; @@ -1210,7 +1211,7 @@ zval *tmp; char *path, *ret = NULL; int path_len; - int opt = PHP_PATHINFO_ALL; + long opt = PHP_PATHINFO_ALL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len, &opt) == FAILURE) { return; Index: ext/sysvsem/sysvsem.c =================================================================== RCS file: /repository/php4/ext/sysvsem/sysvsem.c,v retrieving revision 1.41 diff -u -r1.41 sysvsem.c --- ext/sysvsem/sysvsem.c 27 Sep 2002 10:24:54 -0000 1.41 +++ ext/sysvsem/sysvsem.c 10 Nov 2002 03:46:15 -0000 @@ -161,7 +161,7 @@ Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */ PHP_FUNCTION(sem_get) { - int key, max_acquire, perm, auto_release = 1; + long key, max_acquire, perm, auto_release = 1; int semid; struct sembuf sop[3]; int count; Index: ext/zip/zip.c =================================================================== RCS file: /repository/php4/ext/zip/zip.c,v retrieving revision 1.33 diff -u -r1.33 zip.c --- ext/zip/zip.c 17 Oct 2002 04:42:22 -0000 1.33 +++ ext/zip/zip.c 10 Nov 2002 03:46:15 -0000 @@ -285,7 +285,7 @@ zval *zzip_ent; php_zzip_dirent *entry = NULL; char *buf = NULL; - int len = 1024; + long len = 1024; int ret = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zzip_ent, &len) == FAILURE) { Index: ext/zlib/zlib.c =================================================================== RCS file: /repository/php4/ext/zlib/zlib.c,v retrieving revision 1.153 diff -u -r1.153 zlib.c --- ext/zlib/zlib.c 3 Nov 2002 20:31:00 -0000 1.153 +++ ext/zlib/zlib.c 10 Nov 2002 03:46:15 -0000 @@ -794,7 +794,7 @@ { char *data, *s2; int data_len; - int level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP; + long level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP; int status; z_stream stream; Index: main/output.c =================================================================== RCS file: /repository/php4/main/output.c,v retrieving revision 1.142 diff -u -r1.142 output.c --- main/output.c 7 Oct 2002 11:21:06 -0000 1.142 +++ main/output.c 10 Nov 2002 03:46:15 -0000 @@ -713,7 +713,7 @@ PHP_FUNCTION(ob_start) { zval *output_handler=NULL; - uint chunk_size=0; + ulong chunk_size=0; zend_bool erase=1; int argc = ZEND_NUM_ARGS(); Index: main/streams.c =================================================================== RCS file: /repository/php4/main/streams.c,v retrieving revision 1.124 diff -u -r1.124 streams.c --- main/streams.c 6 Nov 2002 00:15:24 -0000 1.124 +++ main/streams.c 10 Nov 2002 03:46:15 -0000 @@ -1420,7 +1420,7 @@ } if (ret) { fflush(data->file); - *ret = (void*)fd; + *(int*)ret = fd; } return SUCCESS; default: ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20268 -- Edit this bug report at http://bugs.php.net/?id=20268&edit=1