[PHP-CVS] cvs: php-src /ext/com_dotnet com_com.c com_handlers.c com_olechar.c /ext/odbc birdstep.c
iliaa Mon Aug 18 00:41:48 2003 EDT Modified files: /php-src/ext/odbc birdstep.c /php-src/ext/com_dotnet com_handlers.c com_olechar.c com_com.c Log: emalloc -> safe_emalloc Index: php-src/ext/odbc/birdstep.c diff -u php-src/ext/odbc/birdstep.c:1.8 php-src/ext/odbc/birdstep.c:1.9 --- php-src/ext/odbc/birdstep.c:1.8 Mon Jun 16 12:36:41 2003 +++ php-src/ext/odbc/birdstep.c Mon Aug 18 00:41:47 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: birdstep.c,v 1.8 2003/06/16 16:36:41 andrey Exp $ */ +/* $Id: birdstep.c,v 1.9 2003/08/18 04:41:47 iliaa Exp $ */ /* * TODO: @@ -345,7 +345,7 @@ efree(res); RETURN_LONG(rows); } else { /* Was SELECT query */ - res->values = (VResVal *)emalloc(sizeof(VResVal)*cols); + res->values = (VResVal *)safe_emalloc(sizeof(VResVal), cols, 0); res->numcols = cols; for ( i = 0; i < cols; i++ ) { SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_NAME, Index: php-src/ext/com_dotnet/com_handlers.c diff -u php-src/ext/com_dotnet/com_handlers.c:1.1 php-src/ext/com_dotnet/com_handlers.c:1.2 --- php-src/ext/com_dotnet/com_handlers.c:1.1 Thu Aug 14 12:49:55 2003 +++ php-src/ext/com_dotnet/com_handlers.c Mon Aug 18 00:41:48 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: com_handlers.c,v 1.1 2003/08/14 16:49:55 wez Exp $ */ +/* $Id: com_handlers.c,v 1.2 2003/08/18 04:41:48 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -353,7 +353,7 @@ nargs = ZEND_NUM_ARGS(); if (nargs) { - args = (zval **)emalloc(sizeof(zval *) * nargs); + args = (zval **)safe_emalloc(sizeof(zval *), nargs, 0); zend_get_parameters_array(ht, nargs, args); } Index: php-src/ext/com_dotnet/com_olechar.c diff -u php-src/ext/com_dotnet/com_olechar.c:1.1 php-src/ext/com_dotnet/com_olechar.c:1.2 --- php-src/ext/com_dotnet/com_olechar.c:1.1Thu Aug 14 12:49:55 2003 +++ php-src/ext/com_dotnet/com_olechar.cMon Aug 18 00:41:48 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: com_olechar.c,v 1.1 2003/08/14 16:49:55 wez Exp $ */ +/* $Id: com_olechar.c,v 1.2 2003/08/18 04:41:48 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -45,7 +45,7 @@ } if (strlen > 0) { - olestring = (OLECHAR*)emalloc(sizeof(OLECHAR) * string_len); + olestring = (OLECHAR*)safe_emalloc(sizeof(OLECHAR), string_len, 0); ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len); } else { ok = FALSE; @@ -75,7 +75,7 @@ length = WideCharToMultiByte(codepage, 0, olestring, -1, NULL, 0, NULL, NULL); if (length) { - string = (char*)emalloc(sizeof(char) * length); + string = (char*)safe_emalloc(sizeof(char), length, 0); length = WideCharToMultiByte(codepage, 0, olestring, -1, string, length, NULL, NULL); ok = length > 0; } else { Index: php-src/ext/com_dotnet/com_com.c diff -u php-src/ext/com_dotnet/com_com.c:1.1 php-src/ext/com_dotnet/com_com.c:1.2 --- php-src/ext/com_dotnet/com_com.c:1.1Thu Aug 14 12:49:55 2003 +++ php-src/ext/com_dotnet/com_com.cMon Aug 18 00:41:48 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: com_com.c,v 1.1 2003/08/14 16:49:55 wez Exp $ */ +/* $Id: com_com.c,v 1.2 2003/08/18 04:41:48 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -373,7 +373,7 @@ int i; if (nargs) { - vargs = (VARIANT*)emalloc(sizeof(VARIANT) * nargs); + vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0); } /* Invoke'd args are in reverse order */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase interbase.c php_interbase.h
abies Sun Aug 17 20:14:53 2003 EDT Modified files: /php-src/ext/interbase php_interbase.h interbase.c Log: Nuke bogus BLOB ids # User-space BLOB id no longer contains transaction handle, so BLOB ids # now remain valid throughout multiple transactions. # Oh, and they look better too :-) Index: php-src/ext/interbase/php_interbase.h diff -u php-src/ext/interbase/php_interbase.h:1.52 php-src/ext/interbase/php_interbase.h:1.53 --- php-src/ext/interbase/php_interbase.h:1.52 Sat Aug 16 11:31:06 2003 +++ php-src/ext/interbase/php_interbase.h Sun Aug 17 20:14:53 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_interbase.h,v 1.52 2003/08/16 15:31:06 abies Exp $ */ +/* $Id: php_interbase.h,v 1.53 2003/08/18 00:14:53 abies Exp $ */ #ifndef PHP_INTERBASE_H #define PHP_INTERBASE_H @@ -114,6 +114,7 @@ char *cfg_timeformat; char errmsg[MAX_ERRMSG]; long sql_code; + HashTable blob_table; ZEND_END_MODULE_GLOBALS(ibase) typedef struct { @@ -142,10 +143,10 @@ } ibase_array; typedef struct { - isc_tr_handle trans_handle; - isc_db_handle link; - ISC_QUAD bl_qd; + ibase_db_link *link; isc_blob_handle bl_handle; + ISC_QUAD bl_qd; + unsigned short type; } ibase_blob_handle; typedef struct { @@ -164,8 +165,8 @@ } ibase_query; typedef struct { - isc_db_handle link; /* db link for this result */ - isc_tr_handle trans; + ibase_db_link *link; + ibase_trans *trans; isc_stmt_handle stmt; int drop_stmt; XSQLDA *out_sqlda; Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.152 php-src/ext/interbase/interbase.c:1.153 --- php-src/ext/interbase/interbase.c:1.152 Sun Aug 17 12:30:15 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 20:14:53 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: interbase.c,v 1.152 2003/08/17 16:30:15 abies Exp $ */ +/* $Id: interbase.c,v 1.153 2003/08/18 00:14:53 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -51,6 +51,9 @@ #define SAFE_STRING(s) ((s)?(s):"") +#define BLOB_ID_LEN 18 +#define BLOB_ID_MASK "0x%08lx%08lx" + /* {{{ extension definition structures */ function_entry ibase_functions[] = { PHP_FE(ibase_connect, NULL) @@ -264,24 +267,6 @@ short sqlind; } BIND_BUF; -/* get blob identifier from argument - * on empty unset argument ib_blob set to NULL - */ -static int _php_ibase_get_blob_id(zval **blob_arg, ibase_blob_handle **ib_blob) -{ - if (Z_TYPE_PP(blob_arg) == IS_STRING && Z_STRLEN_PP(blob_arg) == 0) { - *ib_blob = NULL; - } else if (Z_TYPE_PP(blob_arg) != IS_STRING -|| Z_STRLEN_PP(blob_arg) != sizeof(ibase_blob_handle) -|| ((ibase_blob_handle *)(Z_STRVAL_PP(blob_arg)))->bl_handle != 0) { - - _php_ibase_module_error("Invalid blob id"); - return FAILURE; - } else { - *ib_blob = (ibase_blob_handle *)Z_STRVAL_PP(blob_arg); - } - return SUCCESS; -} /* get blob handle from argument * note: blob already open when handle active @@ -582,7 +567,6 @@ } _php_ibase_event_free(event->event_buffer,event->result_buffer); } - /* }}} */ /* {{{ startup, shutdown and info functions */ @@ -664,6 +648,8 @@ RESET_ERRMSG; + zend_hash_init(&IBG(blob_table), 0, NULL, NULL, 0); + return SUCCESS; } @@ -690,6 +676,8 @@ } IBG(timeformat) = NULL; + zend_hash_destroy(&IBG(blob_table)); + return SUCCESS; } @@ -699,7 +687,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.152 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.153 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "Yes"); #endif @@ -864,15 +852,15 @@ int open_new_connection = 1; if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le) != FAILURE) { - char tmp_1[] = {isc_info_base_level, isc_info_end}; - char tmp_2[8]; /* Enough? Hope so... */ + static char info[] = {isc_info_base_level, isc_info_end}; + char result[8]; /* Enough? Hope so... */ if (Z_TYPE_P(le) != le_plink) { RETURN_FALSE; } /* Check if connection has timed out */ ib_link = (ibase_db_link *) le->ptr; - if (!isc_database_info(IB_STATUS, &ib
[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS
sniper Sun Aug 17 17:27:56 2003 EDT Modified files: (Branch: PHP_4_3) /php-srcNEWS Log: fix typo Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.352 php-src/NEWS:1.1247.2.353 --- php-src/NEWS:1.1247.2.352 Sun Aug 17 01:57:10 2003 +++ php-src/NEWSSun Aug 17 17:27:55 2003 @@ -6,7 +6,7 @@ on register_globals). (Ilia) - Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields). (Ilia) - Fixed bug #25044 (header("Location:") changing HTTP status). (Marcus) -- Fixed bug #25037 (win23 mail(): Possible infinite loop inside SendText()). +- Fixed bug #25037 (win32 mail(): Possible infinite loop inside SendText()). (Ilia) - Fixed bug #25007 (rand() & mt_rand() seed RNG every call). (Jani) - Fixed bug #24989 (external libexpat conflicts with bundled libexpat). (Jani) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cli php_cli.c
helly Sun Aug 17 15:14:30 2003 EDT Modified files: /php-src/sapi/cli php_cli.c Log: Fix warnings Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.98 php-src/sapi/cli/php_cli.c:1.99 --- php-src/sapi/cli/php_cli.c:1.98 Tue Aug 12 21:29:51 2003 +++ php-src/sapi/cli/php_cli.c Sun Aug 17 15:14:30 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.98 2003/08/13 01:29:51 iliaa Exp $ */ +/* $Id: php_cli.c,v 1.99 2003/08/17 19:14:30 helly Exp $ */ #include "php.h" #include "php_globals.h" @@ -418,7 +418,6 @@ efree(*arg); } -static php_stream_context *sc_in_process = NULL; static php_stream *s_in_process = NULL; static void cli_register_file_handles(TSRMLS_D) @@ -440,7 +439,6 @@ return; } - sc_in_process = sc_in; s_in_process = s_in; php_stream_to_zval(s_in, zin); @@ -525,7 +523,6 @@ int lineno = 0; char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL; const char *param_error=NULL; - int scan_input = 0; int hide_argv = 0; /* end of temporary locals */ #ifdef ZTS @@ -801,7 +798,6 @@ param_error = param_mode_conflict; break; } - scan_input = 1; behavior=PHP_MODE_PROCESS_STDIN; exec_end=optarg; break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
helly Sun Aug 17 14:36:27 2003 EDT Modified files: /php-src/sapi/cgi cgi_main.c Log: Fix interactive mode Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.239 php-src/sapi/cgi/cgi_main.c:1.240 --- php-src/sapi/cgi/cgi_main.c:1.239 Tue Aug 12 22:01:46 2003 +++ php-src/sapi/cgi/cgi_main.c Sun Aug 17 14:36:27 2003 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.239 2003/08/13 02:01:46 iliaa Exp $ */ +/* $Id: cgi_main.c,v 1.240 2003/08/17 18:36:27 helly Exp $ */ #include "php.h" #include "php_globals.h" @@ -922,7 +922,6 @@ char *orig_optarg=optarg; char *script_file=NULL; zend_llist global_vars; - int interactive=0; #if FORCE_CGI_REDIRECT int force_redirect = 1; char *redirect_status_env = NULL; @@ -1312,7 +1311,7 @@ case 'a': /* interactive mode */ printf("Interactive mode enabled\n\n"); - interactive=1; + CG(interactive) = 1; break; case 'C': /* don't chdir to the script directory */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/exif exif.c
helly Sun Aug 17 14:21:35 2003 EDT Modified files: /php-src/ext/exif exif.c Log: Fix warnings Index: php-src/ext/exif/exif.c diff -u php-src/ext/exif/exif.c:1.155 php-src/ext/exif/exif.c:1.156 --- php-src/ext/exif/exif.c:1.155 Sun Aug 17 11:04:57 2003 +++ php-src/ext/exif/exif.c Sun Aug 17 14:21:35 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: exif.c,v 1.155 2003/08/17 15:04:57 sas Exp $ */ +/* $Id: exif.c,v 1.156 2003/08/17 18:21:35 helly Exp $ */ /* ToDos * @@ -111,7 +111,7 @@ }; /* }}} */ -#define EXIF_VERSION "1.4 $Id: exif.c,v 1.155 2003/08/17 15:04:57 sas Exp $" +#define EXIF_VERSION "1.4 $Id: exif.c,v 1.156 2003/08/17 18:21:35 helly Exp $" /* {{{ PHP_MINFO_FUNCTION */ @@ -1313,7 +1313,7 @@ return ""; } -static const tag_table_type exif_get_tag_table(int section) +static tag_table_type exif_get_tag_table(int section) { switch(section) { case SECTION_FILE: return &tag_table_IFD[0]; @@ -1547,7 +1547,7 @@ /* {{{ exif_iif_add_value Add a value to image_info */ -static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value, int motorola_intel TSRMLS_DC) +static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC) { size_t idex; void *vptr; @@ -1574,7 +1574,7 @@ if (value) { length = php_strnlen(value, length); if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, (int *) &length, 0 TSRMLS_CC); + info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); } else { info_value->s = estrndup(value, length); } @@ -1601,7 +1601,7 @@ if (value) { /* do not recompute length here */ if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, (int *) &length, 0 TSRMLS_CC); + info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); } else { info_value->s = estrndup(value, length); } @@ -1684,7 +1684,7 @@ */ static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC) { - exif_iif_add_value(image_info, section_index, name, tag, format, length, value, image_info->motorola_intel TSRMLS_CC); + exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC); } /* }}} */ @@ -3004,7 +3004,7 @@ NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); if ((dir_start+2+NumDirEntries*12) > (offset_base+IFDlength)) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)dir_start+2-(int)offset_base, NumDirEntries, (int)dir_start+2+NumDirEntries*12-(int)offset_base, IFDlength); + exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)((size_t)dir_start+2-(size_t)offset_base), NumDirEntries, (int)((size_t)dir_start+2+NumDirEntries*12-(size_t)offset_base), IFDlength); return FALSE; } @@ -3201,7 +3201,7 @@ Data[0] = (uchar)lh; Data[1] = (uchar)ll; - got = php_stream_read(ImageInfo->infile, Data+2, itemlen-2); /* Read the whole section. */ + got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */ if (got != itemlen-2) { exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2); return FALSE; @@ -3219,7 +3219,7 @@ size = ImageInfo->FileSize - fpos; sn = exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL); Data = ImageInfo->file.list[sn].data; - got = php_stream_read(ImageInfo->infile, Data, size); + got = php_stream_read(ImageInfo->infile, (char*)Data, size);
[PHP-CVS] cvs: php-src / TODO
pollita Sun Aug 17 13:52:20 2003 EDT Modified files: /php-srcTODO Log: No more vectors Index: php-src/TODO diff -u php-src/TODO:1.153 php-src/TODO:1.154 --- php-src/TODO:1.153 Fri May 30 18:32:37 2003 +++ php-src/TODOSun Aug 17 13:52:20 2003 @@ -133,10 +133,6 @@ * Provide a callback facility which is executed upon encountering an unknown class name during deserialization -ext/sockets -* Review/Fix vectors - ext/standard * Add a version number to data serialized via serialize(). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/dba dba.c
helly Sun Aug 17 13:14:11 2003 EDT Modified files: /php-src/ext/dbadba.c Log: Fix warning Index: php-src/ext/dba/dba.c diff -u php-src/ext/dba/dba.c:1.98 php-src/ext/dba/dba.c:1.99 --- php-src/ext/dba/dba.c:1.98 Tue Jul 29 14:26:34 2003 +++ php-src/ext/dba/dba.c Sun Aug 17 13:14:11 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dba.c,v 1.98 2003/07/29 18:26:34 iliaa Exp $ */ +/* $Id: dba.c,v 1.99 2003/08/17 17:14:11 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -663,9 +663,9 @@ file_mode = "w+b"; break; default: - modenr = 0; - lock_mode = 0; - file_mode = ""; + php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode"); + FREENOW; + RETURN_FALSE; } if (!lock_file_mode) { lock_file_mode = file_mode; @@ -694,7 +694,7 @@ lock_mode |= LOCK_NB; /* test =: non blocking */ } } - if (*pmode || !modenr) { + if (*pmode) { php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode"); FREENOW; RETURN_FALSE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/interbase interbase.c
abies Sun Aug 17 12:43:50 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/interbase interbase.c Log: MFH Fixed leak in _php_ibase_bind() Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.91.2.18 php-src/ext/interbase/interbase.c:1.91.2.19 --- php-src/ext/interbase/interbase.c:1.91.2.18 Sun Aug 17 09:26:13 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 12:43:49 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: interbase.c,v 1.91.2.18 2003/08/17 13:26:13 abies Exp $ */ +/* $Id: interbase.c,v 1.91.2.19 2003/08/17 16:43:49 abies Exp $ */ /* TODO: Arrays, roles? @@ -624,7 +624,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.91.2.18 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.91.2.19 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "yes"); #endif @@ -1361,8 +1361,9 @@ efree(ib_blob); return FAILURE; } - ib_blob_id = ib_blob; - var->sqldata = (void ISC_FAR *) &ib_blob_id->bl_qd; + buf[i].val.qval = ib_blob->bl_qd; + var->sqldata = (void ISC_FAR *) &buf[i].val.qval; + efree(ib_blob); /* _php_ibase_module_error("Invalid blob id string"); return FAILURE; @@ -2698,6 +2699,7 @@ RETURN_LONG(zend_list_insert(ib_blob, le_blob)); } +/* }}} */ /* {{{ proto bool ibase_blob_add(int blob_id, string data) Add data into created blob */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/interbase/tests 004.phpt
abies Sun Aug 17 12:40:26 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/interbase/tests004.phpt Log: MFH Index: php-src/ext/interbase/tests/004.phpt diff -u php-src/ext/interbase/tests/004.phpt:1.2.4.4 php-src/ext/interbase/tests/004.phpt:1.2.4.5 --- php-src/ext/interbase/tests/004.phpt:1.2.4.4Sun Aug 17 11:01:07 2003 +++ php-src/ext/interbase/tests/004.phptSun Aug 17 12:40:26 2003 @@ -55,14 +55,7 @@ echo "create blob 2\n"; -$bl_h = ibase_blob_create(); -$ftmp = fopen($name,"r"); -while($piece = fread($ftmp, 1 + rand() % 1024)){ - ibase_blob_add($bl_h, $piece); -} -fclose($ftmp); -$bl_s = ibase_blob_close($bl_h); -ibase_query("insert into test4 (v_integer, v_blob) values (2, ?)", $bl_s); +ibase_query("insert into test4 (v_integer, v_blob) values (2, ?)", $blob_str); echo "test blob 2\n"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase interbase.c
abies Sun Aug 17 12:30:15 2003 EDT Modified files: /php-src/ext/interbase interbase.c Log: Simplify previous fix Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.151 php-src/ext/interbase/interbase.c:1.152 --- php-src/ext/interbase/interbase.c:1.151 Sun Aug 17 12:13:52 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 12:30:15 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: interbase.c,v 1.151 2003/08/17 16:13:52 abies Exp $ */ +/* $Id: interbase.c,v 1.152 2003/08/17 16:30:15 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -262,7 +262,6 @@ #endif } val; short sqlind; - void *allocated; } BIND_BUF; /* get blob identifier from argument @@ -700,7 +699,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.151 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.152 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "Yes"); #endif @@ -1320,7 +1319,6 @@ for (i = 0; i < sqlda->sqld; var++, i++) { /* bound vars */ buf[i].sqlind = 0; - buf[i].allocated = NULL; var->sqlind = &buf[i].sqlind; b_var = b_vars[i]; @@ -1486,8 +1484,8 @@ _php_ibase_error(TSRMLS_C); return FAILURE; } - buf[i].allocated = var->sqldata = (void ISC_FAR *) emalloc(sizeof(ISC_QUAD)); - *(ISC_QUAD ISC_FAR *) var->sqldata = ib_blob.bl_qd; + buf[i].val.qval = ib_blob.bl_qd; + var->sqldata = (void ISC_FAR *) &buf[i].val.qval; } else { var->sqldata = (void ISC_FAR *) &((ibase_blob_handle *) Z_STRVAL_P(b_var))->bl_qd; @@ -1727,17 +1725,8 @@ if (in_sqlda) { efree(in_sqlda); } - if (bind_buf) { - int i; - - /* free memory allocated in binding stage */ - for (i = 0; i < ib_query->in_sqlda->sqld; ++i) { - if (bind_buf[i].allocated != NULL) { - efree(bind_buf[i].allocated); - } - } + if (bind_buf) efree(bind_buf); - } if (rv == FAILURE) { if (IB_RESULT) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase/tests 004.phpt
abies Sun Aug 17 12:14:29 2003 EDT Modified files: /php-src/ext/interbase/tests004.phpt Log: Test immediate BLOB inserts Index: php-src/ext/interbase/tests/004.phpt diff -u php-src/ext/interbase/tests/004.phpt:1.7 php-src/ext/interbase/tests/004.phpt:1.8 --- php-src/ext/interbase/tests/004.phpt:1.7Sun Aug 17 10:58:33 2003 +++ php-src/ext/interbase/tests/004.phptSun Aug 17 12:14:29 2003 @@ -55,14 +55,7 @@ echo "create blob 2\n"; -$bl_h = ibase_blob_create(); -$ftmp = fopen($name,"r"); -while($piece = fread($ftmp, 1 + rand() % 1024)){ - ibase_blob_add($bl_h, $piece); -} -fclose($ftmp); -$bl_s = ibase_blob_close($bl_h); -ibase_query("insert into test4 (v_integer, v_blob) values (2, ?)", $bl_s); +ibase_query("insert into test4 (v_integer, v_blob) values (2, ?)", $blob_str); echo "test blob 2\n"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase interbase.c
abies Sun Aug 17 12:13:52 2003 EDT Modified files: /php-src/ext/interbase interbase.c Log: Fixed leak in _php_ibase_bind() Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.150 php-src/ext/interbase/interbase.c:1.151 --- php-src/ext/interbase/interbase.c:1.150 Sun Aug 17 09:16:54 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 12:13:52 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: interbase.c,v 1.150 2003/08/17 13:16:54 abies Exp $ */ +/* $Id: interbase.c,v 1.151 2003/08/17 16:13:52 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -262,6 +262,7 @@ #endif } val; short sqlind; + void *allocated; } BIND_BUF; /* get blob identifier from argument @@ -699,7 +700,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.150 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.151 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "Yes"); #endif @@ -1319,6 +1320,7 @@ for (i = 0; i < sqlda->sqld; var++, i++) { /* bound vars */ buf[i].sqlind = 0; + buf[i].allocated = NULL; var->sqlind = &buf[i].sqlind; b_var = b_vars[i]; @@ -1462,40 +1464,35 @@ #endif break; case SQL_BLOB: - { - ibase_blob_handle *ib_blob_id; + if (Z_TYPE_P(b_var) != IS_STRING || Z_STRLEN_P(b_var) != sizeof(ibase_blob_handle) || + ((ibase_blob_handle *)(Z_STRVAL_P(b_var)))->bl_handle != 0) { - if (Z_TYPE_P(b_var) != IS_STRING || Z_STRLEN_P(b_var) != sizeof(ibase_blob_handle) || - ((ibase_blob_handle *)(Z_STRVAL_P(b_var)))->bl_handle != 0) { - ibase_blob_handle *ib_blob; - - ib_blob = (ibase_blob_handle *) emalloc(sizeof(ibase_blob_handle)); - ib_blob->trans_handle = ib_query->trans; - ib_blob->link = ib_query->link; - ib_blob->bl_handle = NULL; - if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) { - efree(ib_blob); - _php_ibase_error(TSRMLS_C); - return FAILURE; - } + ibase_blob_handle ib_blob; - if (_php_ibase_blob_add(&b_var, ib_blob TSRMLS_CC) != SUCCESS) { - efree(ib_blob); - return FAILURE; - } - - if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) { - _php_ibase_error(TSRMLS_C); - efree(ib_blob); - return FAILURE; - } - ib_blob_id = ib_blob; - } else { - ib_blob_id = (ibase_blob_handle *) Z_STRVAL_P(b_var); + ib_blob.trans_handle = ib_query->trans->handle; + ib_blob.link = ib_query->link->handle; + ib_blob.bl_handle = NULL; + + if (isc_create_blob(IB_STATUS, &ib_blob.link, &ib_blob.trans_handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) { + _php_ibase_error(TSRMLS_C); + return FAILURE; + } + + if (_php_ibase_blob_add(&b_var, &ib_blob TSRMLS_CC) != SUCCESS) { + return FAILURE; } - var->sqldata = (void ISC_FAR *) &ib_blob_id->bl_qd; +
[PHP-CVS] cvs: php-src /ext/sqlite sqlite.c
helly Sun Aug 17 11:43:41 2003 EDT Modified files: /php-src/ext/sqlite sqlite.c Log: Fix warnings Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.82 php-src/ext/sqlite/sqlite.c:1.83 --- php-src/ext/sqlite/sqlite.c:1.82Tue Aug 12 17:29:28 2003 +++ php-src/ext/sqlite/sqlite.c Sun Aug 17 11:43:41 2003 @@ -17,7 +17,7 @@ | Marcus Boerger <[EMAIL PROTECTED]> | +--+ - $Id: sqlite.c,v 1.82 2003/08/12 21:29:28 helly Exp $ + $Id: sqlite.c,v 1.83 2003/08/17 15:43:41 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -66,6 +66,9 @@ extern int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out); extern int sqlite_decode_binary(const unsigned char *in, unsigned char *out); +#define php_sqlite_encode_binary(in, n, out) sqlite_encode_binary((const unsigned char *)in, n, (unsigned char *)out) +#define php_sqlite_decode_binary(in, out)sqlite_decode_binary((const unsigned char *)in, (unsigned char *)out) + static int le_sqlite_db, le_sqlite_result, le_sqlite_pdb; static inline void php_sqlite_strtoupper(char *s) @@ -947,7 +950,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.82 2003/08/12 21:29:28 helly Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.83 2003/08/17 15:43:41 helly Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -1498,7 +1501,7 @@ ZVAL_NULL(decoded); } else if (decode_binary && rowdata[j][0] == '\x01') { Z_STRVAL_P(decoded) = emalloc(strlen(rowdata[j])); - Z_STRLEN_P(decoded) = sqlite_decode_binary(rowdata[j]+1, Z_STRVAL_P(decoded)); + Z_STRLEN_P(decoded) = php_sqlite_decode_binary(rowdata[j]+1, Z_STRVAL_P(decoded)); Z_STRVAL_P(decoded)[Z_STRLEN_P(decoded)] = '\0'; Z_TYPE_P(decoded) = IS_STRING; if (!buffered) { @@ -1575,7 +1578,7 @@ } else if (decode_binary && rowdata[j] != NULL && rowdata[j][0] == '\x01') { int l = strlen(rowdata[j]); char *decoded = emalloc(l); - l = sqlite_decode_binary(rowdata[j]+1, decoded); + l = php_sqlite_decode_binary(rowdata[j]+1, decoded); decoded[l] = '\0'; RETVAL_STRINGL(decoded, l, 0); if (!res->buffered) { @@ -1747,7 +1750,7 @@ if (decode_binary && rowdata[0] != NULL && rowdata[0][0] == '\x01') { decoded = emalloc(strlen(rowdata[0])); - decoded_len = sqlite_decode_binary(rowdata[0]+1, decoded); + decoded_len = php_sqlite_decode_binary(rowdata[0]+1, decoded); if (!res->buffered) { efree((char*)rowdata[0]); rowdata[0] = NULL; @@ -2305,7 +2308,7 @@ ret = emalloc( 1 + ((256 * stringlen + 1262) / 253) ); ret[0] = '\x01'; - enclen = sqlite_encode_binary((const unsigned char*)string, stringlen, ret+1); + enclen = php_sqlite_encode_binary(string, stringlen, ret+1); RETVAL_STRINGL(ret, enclen+1, 0); } else { @@ -2535,7 +2538,7 @@ ret = emalloc( 1 + ((256 * datalen + 1262) / 253) ); ret[0] = '\x01'; - enclen = sqlite_encode_binary((const unsigned char*)data, datalen, ret+1); + enclen = php_sqlite_encode_binary(data, datalen, ret+1); RETVAL_STRINGL(ret, enclen+1, 0); } else { RETVAL_STRINGL(data, datalen, 1); @@ -2563,7 +2566,7 @@ char *ret; ret = emalloc(datalen); - enclen = sqlite_decode_binary((const unsigned char*)data+1, ret); + enclen = php_sqlite_decode_binary(data+1, ret); ret[enclen] = '\0'; RETVAL_STRINGL(ret, enclen, 0); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/exif exif.c
sas Sun Aug 17 11:04:57 2003 EDT Modified files: /php-src/ext/exif exif.c Log: kill some warnings Index: php-src/ext/exif/exif.c diff -u php-src/ext/exif/exif.c:1.154 php-src/ext/exif/exif.c:1.155 --- php-src/ext/exif/exif.c:1.154 Sat Aug 9 16:43:06 2003 +++ php-src/ext/exif/exif.c Sun Aug 17 11:04:57 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: exif.c,v 1.154 2003/08/09 20:43:06 helly Exp $ */ +/* $Id: exif.c,v 1.155 2003/08/17 15:04:57 sas Exp $ */ /* ToDos * @@ -111,7 +111,7 @@ }; /* }}} */ -#define EXIF_VERSION "1.4 $Id: exif.c,v 1.154 2003/08/09 20:43:06 helly Exp $" +#define EXIF_VERSION "1.4 $Id: exif.c,v 1.155 2003/08/17 15:04:57 sas Exp $" /* {{{ PHP_MINFO_FUNCTION */ @@ -1574,7 +1574,7 @@ if (value) { length = php_strnlen(value, length); if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); + info_value->s = php_addslashes(value, length, (int *) &length, 0 TSRMLS_CC); } else { info_value->s = estrndup(value, length); } @@ -1601,7 +1601,7 @@ if (value) { /* do not recompute length here */ if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); + info_value->s = php_addslashes(value, length, (int *) &length, 0 TSRMLS_CC); } else { info_value->s = estrndup(value, length); } @@ -1841,7 +1841,7 @@ static void add_assoc_image_info(pval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC) { charbuffer[64], *val, *name, uname[64]; - int i, ap, l, b, idx=0, done, unknown=0; + int i, ap, l, b, idx=0, unknown=0; #ifdef EXIF_DEBUG int info_tag; #endif @@ -1861,7 +1861,6 @@ } for(i=0; iinfo_list[section_index].count; i++) { - done = 0; info_data = &image_info->info_list[section_index].list[i]; #ifdef EXIF_DEBUG info_tag = info_data->tag; /* conversion */ @@ -2735,7 +2734,7 @@ // JPEG does not use absolute pointers instead its pointers are relative to the start // of the TIFF header in APP1 section. */ - if (offset_val<0 || offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) { + if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) { if (value_ptr < dir_entry) { /* we can read this if offset_val > 0 */ /* some files have their values in other parts of the file */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/interbase/tests 004.phpt
abies Sun Aug 17 11:01:07 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/interbase/tests004.phpt Log: MFH Index: php-src/ext/interbase/tests/004.phpt diff -u php-src/ext/interbase/tests/004.phpt:1.2.4.3 php-src/ext/interbase/tests/004.phpt:1.2.4.4 --- php-src/ext/interbase/tests/004.phpt:1.2.4.3Sat Aug 16 16:10:51 2003 +++ php-src/ext/interbase/tests/004.phptSun Aug 17 11:01:07 2003 @@ -67,14 +67,10 @@ echo "test blob 2\n"; $q = ibase_query("select v_blob from test4 where v_integer = 2"); -$row = ibase_fetch_object($q); -$bl_h = ibase_blob_open($row->V_BLOB); - $blob = ''; -while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) -$blob .= $piece; -if($blob != $blob_str) +$row = ibase_fetch_object($q,IBASE_TEXT); + +if($row->V_BLOB != $blob_str) echo " BLOB 2 fail\n"; -ibase_blob_close($bl_h); ibase_free_result($q); unset($blob); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase/tests 004.phpt
abies Sun Aug 17 10:58:33 2003 EDT Modified files: /php-src/ext/interbase/tests004.phpt Log: Test fetching BLOBs >64k Index: php-src/ext/interbase/tests/004.phpt diff -u php-src/ext/interbase/tests/004.phpt:1.6 php-src/ext/interbase/tests/004.phpt:1.7 --- php-src/ext/interbase/tests/004.phpt:1.6Sat Aug 16 16:04:41 2003 +++ php-src/ext/interbase/tests/004.phptSun Aug 17 10:58:33 2003 @@ -67,14 +67,10 @@ echo "test blob 2\n"; $q = ibase_query("select v_blob from test4 where v_integer = 2"); -$row = ibase_fetch_object($q); -$bl_h = ibase_blob_open($row->V_BLOB); - $blob = ''; -while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) -$blob .= $piece; -if($blob != $blob_str) +$row = ibase_fetch_object($q,IBASE_TEXT); + +if($row->V_BLOB != $blob_str) echo " BLOB 2 fail\n"; -ibase_blob_close($bl_h); ibase_free_result($q); unset($blob); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard Makefile.frag
sas Sun Aug 17 10:16:03 2003 EDT Modified files: /php-src/ext/standard Makefile.frag Log: Use explicit rule to create parsedate.c Index: php-src/ext/standard/Makefile.frag diff -u php-src/ext/standard/Makefile.frag:1.3 php-src/ext/standard/Makefile.frag:1.4 --- php-src/ext/standard/Makefile.frag:1.3 Thu Jun 27 06:01:06 2002 +++ php-src/ext/standard/Makefile.frag Sun Aug 17 10:16:03 2003 @@ -1,5 +1,6 @@ $(srcdir)/parsedate.c: $(srcdir)/parsedate.y + $(YACC) $(srcdir)/parsedate.y -o $@ $(srcdir)/var_unserializer.c: $(srcdir)/var_unserializer.re re2c -b $(srcdir)/var_unserializer.re > $@ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite/libsqlite/src vdbe.c
sas Sun Aug 17 10:01:17 2003 EDT Modified files: /php-src/ext/sqlite/libsqlite/src vdbe.c Log: Use %p to display a pointer value Index: php-src/ext/sqlite/libsqlite/src/vdbe.c diff -u php-src/ext/sqlite/libsqlite/src/vdbe.c:1.3 php-src/ext/sqlite/libsqlite/src/vdbe.c:1.4 --- php-src/ext/sqlite/libsqlite/src/vdbe.c:1.3 Fri Jun 6 18:44:57 2003 +++ php-src/ext/sqlite/libsqlite/src/vdbe.c Sun Aug 17 10:01:17 2003 @@ -36,7 +36,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.3 2003/06/06 22:44:57 wez Exp $ +** $Id: vdbe.c,v 1.4 2003/08/17 14:01:17 sas Exp $ */ #include "sqliteInt.h" #include @@ -1276,7 +1276,7 @@ sprintf(p->zStack[2],"%d", p->aOp[i].p1); sprintf(p->zStack[3],"%d", p->aOp[i].p2); if( p->aOp[i].p3type==P3_POINTER ){ - sprintf(p->aStack[4].z, "ptr(%#x)", (int)p->aOp[i].p3); + sprintf(p->aStack[4].z, "ptr(%p)", p->aOp[i].p3); p->zStack[4] = p->aStack[4].z; }else{ p->zStack[4] = p->aOp[i].p3; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite/libsqlite/src table.c
sas Sun Aug 17 09:59:59 2003 EDT Modified files: /php-src/ext/sqlite/libsqlite/src table.c Log: The first element of the array seems to store the members count Add a cast to (long) to quiet the compiler Index: php-src/ext/sqlite/libsqlite/src/table.c diff -u php-src/ext/sqlite/libsqlite/src/table.c:1.2 php-src/ext/sqlite/libsqlite/src/table.c:1.3 --- php-src/ext/sqlite/libsqlite/src/table.c:1.2Wed Jun 4 18:40:00 2003 +++ php-src/ext/sqlite/libsqlite/src/table.cSun Aug 17 09:59:59 2003 @@ -195,7 +195,7 @@ int i, n; azResult--; if( azResult==0 ) return; -n = (int)azResult[0]; +n = (int)(long)azResult[0]; for(i=1; ihttp://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite/libsqlite/src main.c
sas Sun Aug 17 09:57:53 2003 EDT Modified files: /php-src/ext/sqlite/libsqlite/src main.c Log: The integer timeout is cast to a void *, passed to this function, and cast back. Add a cast to (long) to quiet the compiler Index: php-src/ext/sqlite/libsqlite/src/main.c diff -u php-src/ext/sqlite/libsqlite/src/main.c:1.3 php-src/ext/sqlite/libsqlite/src/main.c:1.4 --- php-src/ext/sqlite/libsqlite/src/main.c:1.3 Fri Jun 6 18:44:56 2003 +++ php-src/ext/sqlite/libsqlite/src/main.c Sun Aug 17 09:57:53 2003 @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.3 2003/06/06 22:44:56 wez Exp $ +** $Id: main.c,v 1.4 2003/08/17 13:57:53 sas Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -764,7 +764,8 @@ #if SQLITE_MIN_SLEEP_MS==1 int delay = 10; int prior_delay = 0; - int timeout = (int)Timeout; + /* We seem to be called by a generic cb mechanism which passes void ptrs */ + int timeout = (int)(long)Timeout; int i; for(i=1; i timeout ){ return 0; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite/libsqlite/src build.c
sas Sun Aug 17 09:53:57 2003 EDT Modified files: /php-src/ext/sqlite/libsqlite/src build.c Log: Fix sizeof(void *) > sizeof(int) issue. n should be ptrdiff_t. Index: php-src/ext/sqlite/libsqlite/src/build.c diff -u php-src/ext/sqlite/libsqlite/src/build.c:1.3 php-src/ext/sqlite/libsqlite/src/build.c:1.4 --- php-src/ext/sqlite/libsqlite/src/build.c:1.3Fri Jun 6 18:44:56 2003 +++ php-src/ext/sqlite/libsqlite/src/build.cSun Aug 17 09:53:57 2003 @@ -23,7 +23,7 @@ ** ROLLBACK ** PRAGMA ** -** $Id: build.c,v 1.3 2003/06/06 22:44:56 wez Exp $ +** $Id: build.c,v 1.4 2003/08/17 13:53:57 sas Exp $ */ #include "sqliteInt.h" #include @@ -1076,7 +1076,7 @@ sEnd.z += sEnd.n; } sEnd.n = 0; - n = ((int)sEnd.z) - (int)pBegin->z; + n = (char *) sEnd.z - (char *) pBegin->z; z = pBegin->z; while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } sEnd.z = &z[n-1]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams php_stream_transport.h
sas Sun Aug 17 09:49:52 2003 EDT Modified files: /php-src/main/streams php_stream_transport.h Log: One bit fields need to be unsigned, otherwise there is no storage for the sign bit "A signed bit field has a length of 1 bit." Index: php-src/main/streams/php_stream_transport.h diff -u php-src/main/streams/php_stream_transport.h:1.5 php-src/main/streams/php_stream_transport.h:1.6 --- php-src/main/streams/php_stream_transport.h:1.5 Tue Jul 1 21:35:39 2003 +++ php-src/main/streams/php_stream_transport.h Sun Aug 17 09:49:52 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_stream_transport.h,v 1.5 2003/07/02 01:35:39 wez Exp $ */ +/* $Id: php_stream_transport.h,v 1.6 2003/08/17 13:49:52 sas Exp $ */ #if HAVE_SYS_SOCKET_H # include @@ -98,9 +98,9 @@ STREAM_XPORT_OP_GET_NAME, STREAM_XPORT_OP_GET_PEER_NAME } op; - int want_addr:1; - int want_textaddr:1; - int want_errortext:1; + unsigned int want_addr:1; + unsigned int want_textaddr:1; + unsigned int want_errortext:1; struct { char *name; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/interbase interbase.c
abies Sun Aug 17 09:26:14 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/interbase interbase.c Log: MFH Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.91.2.17 php-src/ext/interbase/interbase.c:1.91.2.18 --- php-src/ext/interbase/interbase.c:1.91.2.17 Sat Aug 16 16:12:43 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 09:26:13 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: interbase.c,v 1.91.2.17 2003/08/16 20:12:43 abies Exp $ */ +/* $Id: interbase.c,v 1.91.2.18 2003/08/17 13:26:13 abies Exp $ */ /* TODO: Arrays, roles? @@ -624,7 +624,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.91.2.17 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.91.2.18 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "yes"); #endif @@ -1157,6 +1157,28 @@ } /* }}} */ +/* ((( _php_ibase_blob_add */ +static int _php_ibase_blob_add(zval **string_arg, ibase_blob_handle *ib_blob TSRMLS_DC) +{ + unsigned long put_cnt = 0, rem_cnt; + unsigned short chunk_size; + + convert_to_string_ex(string_arg); + + for (rem_cnt = Z_STRLEN_PP(string_arg); rem_cnt > 0; rem_cnt -= chunk_size) { + + chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt; + + if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, chunk_size, &Z_STRVAL_PP(string_arg)[put_cnt] )) { + _php_ibase_error(TSRMLS_C); + return FAILURE; + } + put_cnt += chunk_size; + } + return SUCCESS; +} +/* }}} */ + /* {{{ _php_ibase_bind() Bind parameter placeholders in a previously prepared query */ static int _php_ibase_bind(XSQLDA *sqlda, zval **b_vars, BIND_BUF *buf, ibase_query *ib_query TSRMLS_DC) @@ -1314,6 +1336,7 @@ case SQL_BLOB: { ibase_blob_handle *ib_blob_id; + if (Z_TYPE_P(b_var) != IS_STRING || Z_STRLEN_P(b_var) != sizeof(ibase_blob_handle) || ((ibase_blob_handle *)(Z_STRVAL_P(b_var)))->bl_handle != 0) { ibase_blob_handle *ib_blob; @@ -1327,13 +1350,15 @@ _php_ibase_error(TSRMLS_C); return FAILURE; } - convert_to_string(b_var); - if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(b_var), Z_STRVAL_P(b_var))) { - _php_ibase_error(TSRMLS_C); + + if (_php_ibase_blob_add(&b_var, ib_blob TSRMLS_CC) != SUCCESS) { + efree(ib_blob); return FAILURE; } + if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) { _php_ibase_error(TSRMLS_C); + efree(ib_blob); return FAILURE; } ib_blob_id = ib_blob; @@ -1976,6 +2001,41 @@ } /* }}} */ + +/* {{{ _php_ibase_blob_get */ +static int _php_ibase_blob_get(zval *return_value, ibase_blob_handle *ib_blob, unsigned long max_len TSRMLS_DC) +{ + if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/ + + ISC_STATUS stat; + char *bl_data; + unsigned long cur_len; + unsigned short seg_len; + + bl_data = emalloc(max_len + 1); + + for (cur_len = stat = 0; (stat == 0 || stat == isc_segment) && cur_len < max_len; cur_len += seg_len) { + + unsigned short chunk_size = (max_len-cur_len) > USHRT_MAX ? USHRT_MAX : (unsigned short)(max_len-cur_len); + + stat = isc_get_segment(IB_STATUS, &ib_blob->bl_handle, &seg_len, chunk_size, &bl_data[cur_len]); + } + + bl_data[cur_len] = '\0'; + if (IB_STATUS[0] == 1 && (stat != 0 && stat != isc_segstr_eof && stat != isc_segment))
[PHP-CVS] cvs: php-src /ext/interbase interbase.c
abies Sun Aug 17 09:16:55 2003 EDT Modified files: /php-src/ext/interbase interbase.c Log: Fix possible leak in _php_ibase_fetch_hash() Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.149 php-src/ext/interbase/interbase.c:1.150 --- php-src/ext/interbase/interbase.c:1.149 Sun Aug 17 08:31:55 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 09:16:54 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: interbase.c,v 1.149 2003/08/17 12:31:55 abies Exp $ */ +/* $Id: interbase.c,v 1.150 2003/08/17 13:16:54 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -699,7 +699,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.149 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.150 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "Yes"); #endif @@ -2606,8 +2606,8 @@ var = ib_result->out_sqlda->sqlvar; for (i = 0; i < ib_result->out_sqlda->sqld; i++, var++) { if (((var->sqltype & 1) == 0) || *var->sqlind != -1) { - zval *tmp; - tmp = emalloc(sizeof(zval)); + zval tmp; + switch (var->sqltype & ~1) { case SQL_VARYING: case SQL_TEXT: @@ -2625,7 +2625,7 @@ case SQL_TYPE_DATE: case SQL_TYPE_TIME: #endif - _php_ibase_var_zval(tmp, var->sqldata, var->sqltype, var->sqllen, var->sqlscale, flag TSRMLS_CC); + _php_ibase_var_zval(&tmp, var->sqldata, var->sqltype, var->sqllen, var->sqlscale, flag TSRMLS_CC); break; case SQL_BLOB: if (flag & PHP_IBASE_FETCH_BLOBS) { /* fetch blob contents into hash */ @@ -2665,25 +2665,25 @@ RETURN_FALSE; } - if (_php_ibase_blob_get(tmp, &blob_handle, max_len TSRMLS_CC) != SUCCESS) { + if (_php_ibase_blob_get(&tmp, &blob_handle, max_len TSRMLS_CC) != SUCCESS) { RETURN_FALSE; } if (isc_close_blob(IB_STATUS, &blob_handle.bl_handle)) { + zval_dtor(&tmp); _php_ibase_error(TSRMLS_C); + RETURN_FALSE; } } else { /* blob id only */ - ISC_QUAD *bl_qd = (ISC_QUAD ISC_FAR *) var->sqldata; - ibase_blob_handle *ib_blob_id; - - ib_blob_id = (ibase_blob_handle *) ecalloc(1, sizeof(ibase_blob_handle) + 1); + + ibase_blob_handle *ib_blob_id = (ibase_blob_handle *) ecalloc(1, sizeof(ibase_blob_handle) + 1); ib_blob_id->link = ib_result->link; ib_blob_id->trans_handle = ib_result->trans; - ib_blob_id->bl_qd = *bl_qd; + ib_blob_id->bl_qd = *(ISC_QUAD ISC_FAR *) var->sqldata; - ZVAL_STRINGL(tmp, (char *) ib_blob_id, sizeof(ibase_blob_handle),0); + ZVAL_STRINGL(&tmp, (char *) ib_blob_id, sizeof(ibase_blob_handle),0); } break; case SQL_ARRAY: { @@ -2703,7 +2703,7 @@ } tmp_ptr = ar_data; /* avoid changes in _arr_zval */ - if (_php_ibase_arr_zval(tmp, &tmp_ptr, ib_array, 0, flag TSRMLS_CC) == FAILURE) { + if (_
[PHP-CVS] cvs: php-src /ext/interbase interbase.c
abies Sun Aug 17 08:31:55 2003 EDT Modified files: /php-src/ext/interbase interbase.c Log: Apply fix for ibase_blob_get() to ibase_fetch_*() Apply fix for ibase_blob_add() to ibase_query()/ibase_execute() Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.148 php-src/ext/interbase/interbase.c:1.149 --- php-src/ext/interbase/interbase.c:1.148 Sat Aug 16 15:48:32 2003 +++ php-src/ext/interbase/interbase.c Sun Aug 17 08:31:55 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: interbase.c,v 1.148 2003/08/16 19:48:32 abies Exp $ */ +/* $Id: interbase.c,v 1.149 2003/08/17 12:31:55 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -699,7 +699,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.148 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.149 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "Yes"); #endif @@ -1285,6 +1285,28 @@ } /* }}} */ +/* ((( _php_ibase_blob_add */ +static int _php_ibase_blob_add(zval **string_arg, ibase_blob_handle *ib_blob TSRMLS_DC) +{ + unsigned long put_cnt = 0, rem_cnt; + unsigned short chunk_size; + + convert_to_string_ex(string_arg); + + for (rem_cnt = Z_STRLEN_PP(string_arg); rem_cnt > 0; rem_cnt -= chunk_size) { + + chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt; + + if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, chunk_size, &Z_STRVAL_PP(string_arg)[put_cnt] )) { + _php_ibase_error(TSRMLS_C); + return FAILURE; + } + put_cnt += chunk_size; + } + return SUCCESS; +} +/* }}} */ + /* {{{ _php_ibase_bind() Bind parameter placeholders in a previously prepared query */ static int _php_ibase_bind(XSQLDA *sqlda, zval **b_vars, BIND_BUF *buf, ibase_query *ib_query TSRMLS_DC) @@ -1442,6 +1464,7 @@ case SQL_BLOB: { ibase_blob_handle *ib_blob_id; + if (Z_TYPE_P(b_var) != IS_STRING || Z_STRLEN_P(b_var) != sizeof(ibase_blob_handle) || ((ibase_blob_handle *)(Z_STRVAL_P(b_var)))->bl_handle != 0) { ibase_blob_handle *ib_blob; @@ -1455,13 +1478,15 @@ _php_ibase_error(TSRMLS_C); return FAILURE; } - convert_to_string(b_var); - if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(b_var), Z_STRVAL_P(b_var))) { - _php_ibase_error(TSRMLS_C); + + if (_php_ibase_blob_add(&b_var, ib_blob TSRMLS_CC) != SUCCESS) { + efree(ib_blob); return FAILURE; } + if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) { _php_ibase_error(TSRMLS_C); + efree(ib_blob); return FAILURE; } ib_blob_id = ib_blob; @@ -1612,8 +1637,7 @@ default: - Z_BVAL_P(return_value) = 1; - Z_TYPE_P(return_value) = IS_BOOL; + RETVAL_BOOL(1); } /* allocate sqlda and output buffers */ @@ -1668,6 +1692,8 @@ switch (ib_query->statement_type) { + unsigned long affected_rows; + case isc_info_sql_stmt_insert: case isc_info_sql_stmt_update: case isc_info_sql_stmt_delete: @@ -1677,6 +1703,8 @@ _php_ibase_error(TSRMLS_C); goto _php_ibase_exec_error; } + + affected_rows = 0; if (result[0] == isc_info_sql_records) { unsigned i = 3, result_size = isc_vax_integer(&result[1],2); @@ -1684,11 +1712,15
[PHP-CVS] cvs: php-src /tests/classes singleton_001.phpt
helly Sun Aug 17 08:13:26 2003 EDT Modified files: /php-src/tests/classes singleton_001.phpt Log: Once is enough Index: php-src/tests/classes/singleton_001.phpt diff -u php-src/tests/classes/singleton_001.phpt:1.2 php-src/tests/classes/singleton_001.phpt:1.3 --- php-src/tests/classes/singleton_001.phpt:1.2Sat Aug 9 10:48:47 2003 +++ php-src/tests/classes/singleton_001.phptSun Aug 17 08:13:26 2003 @@ -1,5 +1,5 @@ --TEST-- -ZE2 ZE2 singleton +ZE2 singleton --SKIPIF-- --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard parsedate.y
derick Sun Aug 17 07:49:18 2003 EDT Modified files: /php-src/ext/standard parsedate.y Log: - Fix the comment too Index: php-src/ext/standard/parsedate.y diff -u php-src/ext/standard/parsedate.y:1.38 php-src/ext/standard/parsedate.y:1.39 --- php-src/ext/standard/parsedate.y:1.38 Sun Aug 17 07:48:29 2003 +++ php-src/ext/standard/parsedate.ySun Aug 17 07:49:18 2003 @@ -8,7 +8,7 @@ ** This code is in the public domain and has no copyright. */ -/* $Id: parsedate.y,v 1.38 2003/08/17 11:48:29 derick Exp $ */ +/* $Id: parsedate.y,v 1.39 2003/08/17 11:49:18 derick Exp $ */ #include "php.h" @@ -150,7 +150,7 @@ %} -/* This grammar has 14 shift/reduce conflicts. */ +/* This grammar has 17 shift/reduce conflicts. */ %expect 17 %pure_parser -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard parsedate.y
derick Sun Aug 17 07:48:29 2003 EDT Modified files: /php-src/ext/standard parsedate.y Log: - This parser contains 17 reduce conflicts Index: php-src/ext/standard/parsedate.y diff -u php-src/ext/standard/parsedate.y:1.37 php-src/ext/standard/parsedate.y:1.38 --- php-src/ext/standard/parsedate.y:1.37 Sat Aug 16 16:55:27 2003 +++ php-src/ext/standard/parsedate.ySun Aug 17 07:48:29 2003 @@ -8,7 +8,7 @@ ** This code is in the public domain and has no copyright. */ -/* $Id: parsedate.y,v 1.37 2003/08/16 20:55:27 derick Exp $ */ +/* $Id: parsedate.y,v 1.38 2003/08/17 11:48:29 derick Exp $ */ #include "php.h" @@ -151,7 +151,7 @@ %} /* This grammar has 14 shift/reduce conflicts. */ -%expect 14 +%expect 17 %pure_parser %token tAGO tDAY tDAY_UNIT tDAYZONE tDST tHOUR_UNIT tID -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard dl.c
david Sun Aug 17 05:57:21 2003 EDT Modified files: /php-src/ext/standard dl.c Log: #typo Index: php-src/ext/standard/dl.c diff -u php-src/ext/standard/dl.c:1.83 php-src/ext/standard/dl.c:1.84 --- php-src/ext/standard/dl.c:1.83 Tue Jun 10 16:03:37 2003 +++ php-src/ext/standard/dl.c Sun Aug 17 05:57:21 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: dl.c,v 1.83 2003/06/10 20:03:37 imajes Exp $ */ +/* $Id: dl.c,v 1.84 2003/08/17 09:57:21 david Exp $ */ #include "php.h" #include "dl.h" @@ -77,7 +77,7 @@ convert_to_string_ex(file); if (!PG(enable_dl)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extentions aren't enabled"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled"); } else if (PG(safe_mode)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't allowed when running in Safe Mode"); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php