iliaa Mon May 28 23:33:13 2007 UTC Modified files: /php-src/ext/sqlite sqlite.c php_sqlite.h /php-src/ext/sockets php_sockets.h /php-src/ext/pdo_pgsql pgsql_statement.c /php-src/ext/pdo_firebird firebird_statement.c /php-src/ext/openssl openssl.c /php-src/ext/mime_magic mime_magic.c /php-src/ext/interbase php_ibase_udf.c /php-src/ext/imap php_imap.c Log: MFB
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.201&r2=1.202&diff_format=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.201 php-src/ext/sqlite/sqlite.c:1.202 --- php-src/ext/sqlite/sqlite.c:1.201 Wed Jan 3 20:49:27 2007 +++ php-src/ext/sqlite/sqlite.c Mon May 28 23:33:12 2007 @@ -17,7 +17,7 @@ | Marcus Boerger <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: sqlite.c,v 1.201 2007/01/03 20:49:27 tony2001 Exp $ + $Id: sqlite.c,v 1.202 2007/05/28 23:33:12 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -81,7 +81,7 @@ 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) +#define php_sqlite_decode_binary(in, out) in && *in ? sqlite_decode_binary((const unsigned char *)in, (unsigned char *)out) : 0 static int sqlite_count_elements(zval *object, long *count TSRMLS_DC); @@ -341,7 +341,7 @@ sqlite_functions, PHP_MINIT(sqlite), PHP_MSHUTDOWN(sqlite), - PHP_RINIT(sqlite), + NULL, PHP_RSHUTDOWN(sqlite), PHP_MINFO(sqlite), #if ZEND_MODULE_API_NO >= 20010901 @@ -1220,7 +1220,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.201 2007/01/03 20:49:27 tony2001 Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.202 2007/05/28 23:33:12 iliaa 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(); http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/php_sqlite.h?r1=1.36&r2=1.37&diff_format=u Index: php-src/ext/sqlite/php_sqlite.h diff -u php-src/ext/sqlite/php_sqlite.h:1.36 php-src/ext/sqlite/php_sqlite.h:1.37 --- php-src/ext/sqlite/php_sqlite.h:1.36 Mon Jan 1 09:29:30 2007 +++ php-src/ext/sqlite/php_sqlite.h Mon May 28 23:33:12 2007 @@ -17,7 +17,7 @@ | Marcus Boerger <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: php_sqlite.h,v 1.36 2007/01/01 09:29:30 sebastian Exp $ + $Id: php_sqlite.h,v 1.37 2007/05/28 23:33:12 iliaa Exp $ */ #ifndef PHP_SQLITE_H @@ -38,7 +38,6 @@ PHP_MINIT_FUNCTION(sqlite); PHP_MSHUTDOWN_FUNCTION(sqlite); -PHP_RINIT_FUNCTION(sqlite); PHP_RSHUTDOWN_FUNCTION(sqlite); PHP_MINFO_FUNCTION(sqlite); http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/php_sockets.h?r1=1.39&r2=1.40&diff_format=u Index: php-src/ext/sockets/php_sockets.h diff -u php-src/ext/sockets/php_sockets.h:1.39 php-src/ext/sockets/php_sockets.h:1.40 --- php-src/ext/sockets/php_sockets.h:1.39 Wed Jan 10 21:26:09 2007 +++ php-src/ext/sockets/php_sockets.h Mon May 28 23:33:13 2007 @@ -22,7 +22,7 @@ #ifndef PHP_SOCKETS_H #define PHP_SOCKETS_H -/* $Id: php_sockets.h,v 1.39 2007/01/10 21:26:09 bjori Exp $ */ +/* $Id: php_sockets.h,v 1.40 2007/05/28 23:33:13 iliaa Exp $ */ #if HAVE_SOCKETS @@ -41,7 +41,6 @@ PHP_MINIT_FUNCTION(sockets); PHP_MINFO_FUNCTION(sockets); -PHP_RINIT_FUNCTION(sockets); PHP_RSHUTDOWN_FUNCTION(sockets); PHP_FUNCTION(socket_select); http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.43&r2=1.44&diff_format=u Index: php-src/ext/pdo_pgsql/pgsql_statement.c diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.43 php-src/ext/pdo_pgsql/pgsql_statement.c:1.44 --- php-src/ext/pdo_pgsql/pgsql_statement.c:1.43 Mon Jan 1 09:29:28 2007 +++ php-src/ext/pdo_pgsql/pgsql_statement.c Mon May 28 23:33:13 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql_statement.c,v 1.43 2007/01/01 09:29:28 sebastian Exp $ */ +/* $Id: pgsql_statement.c,v 1.44 2007/05/28 23:33:13 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -205,6 +205,7 @@ S->param_lengths[param->paramno] = 1; S->param_formats[param->paramno] = 1; } else { + SEPARATE_ZVAL_IF_NOT_REF(¶m->parameter); convert_to_string(param->parameter); S->param_values[param->paramno] = Z_STRVAL_P(param->parameter); S->param_lengths[param->paramno] = Z_STRLEN_P(param->parameter); http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/firebird_statement.c?r1=1.21&r2=1.22&diff_format=u Index: php-src/ext/pdo_firebird/firebird_statement.c diff -u php-src/ext/pdo_firebird/firebird_statement.c:1.21 php-src/ext/pdo_firebird/firebird_statement.c:1.22 --- php-src/ext/pdo_firebird/firebird_statement.c:1.21 Sat Feb 24 16:25:54 2007 +++ php-src/ext/pdo_firebird/firebird_statement.c Mon May 28 23:33:13 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: firebird_statement.c,v 1.21 2007/02/24 16:25:54 helly Exp $ */ +/* $Id: firebird_statement.c,v 1.22 2007/05/28 23:33:13 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -655,8 +655,7 @@ RECORD_ERROR(stmt); return 0; } - strncpy(S->name, Z_STRVAL_P(val), sizeof(S->name)); - S->name[sizeof(S->name)] = 0; + strlcpy(S->name, Z_STRVAL_P(val), sizeof(S->name)); break; } return 1; http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.139&r2=1.140&diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.139 php-src/ext/openssl/openssl.c:1.140 --- php-src/ext/openssl/openssl.c:1.139 Mon May 28 13:53:54 2007 +++ php-src/ext/openssl/openssl.c Mon May 28 23:33:13 2007 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: openssl.c,v 1.139 2007/05/28 13:53:54 pajoye Exp $ */ +/* $Id: openssl.c,v 1.140 2007/05/28 23:33:13 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1542,13 +1542,13 @@ } /* }}} */ -/* {{{ proto bool openssl_pkcs12_read(mixed PKCS12, array &certs, string pass) +/* {{{ proto bool openssl_pkcs12_read(string PKCS12, array &certs, string pass) Parses a PKCS12 to an array */ PHP_FUNCTION(openssl_pkcs12_read) { - zval *zp12 = NULL, *zout = NULL, *zextracerts, *zcert, *zpkey; - char * pass; - int pass_len; + zval *zout = NULL, *zextracerts, *zcert, *zpkey; + char *pass, *zp12; + int pass_len, zp12_len; PKCS12 * p12 = NULL; EVP_PKEY * pkey = NULL; X509 * cert = NULL; @@ -1556,7 +1556,7 @@ BIO * bio_in = NULL; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzs", &zp12, &zout, &pass, &pass_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szs", &zp12, &zout, &pass, &pass_len) == FAILURE) { return; } @@ -1564,7 +1564,7 @@ bio_in = BIO_new(BIO_s_mem()); - if(!BIO_write(bio_in, Z_STRVAL_P(zp12), Z_STRLEN_P(zp12))) + if(!BIO_write(bio_in, zp12, zp12_len)) goto cleanup; if(d2i_PKCS12_bio(bio_in, &p12)) { http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.55&r2=1.56&diff_format=u Index: php-src/ext/mime_magic/mime_magic.c diff -u php-src/ext/mime_magic/mime_magic.c:1.55 php-src/ext/mime_magic/mime_magic.c:1.56 --- php-src/ext/mime_magic/mime_magic.c:1.55 Wed Jan 3 20:49:27 2007 +++ php-src/ext/mime_magic/mime_magic.c Mon May 28 23:33:13 2007 @@ -15,7 +15,7 @@ | Author: Hartmut Holzgraefe <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: mime_magic.c,v 1.55 2007/01/03 20:49:27 tony2001 Exp $ + $Id: mime_magic.c,v 1.56 2007/05/28 23:33:13 iliaa Exp $ This module contains a lot of stuff taken from Apache mod_mime_magic, so the license section is a little bit longer than usual: @@ -1156,21 +1156,29 @@ php_stream_statbuf stat_ssb; switch (Z_TYPE_P(what)) { - case IS_STRING: - if(!php_stream_stat_path(Z_STRVAL_P(what), &stat_ssb)) { - return MIME_MAGIC_OK; - } - break; - case IS_RESOURCE: - { - php_stream *stream; - - php_stream_from_zval_no_verify(stream, &what); - if(!php_stream_stat(stream, &stat_ssb)) { - return MIME_MAGIC_OK; + case IS_STRING: + if (php_stream_stat_path_ex(Z_STRVAL_P(what), PHP_STREAM_URL_STAT_QUIET, &stat_ssb, NULL)) { + if (MIME_MAGIC_G(debug)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-statable file path (%s)", Z_STRVAL_P(what)); + } + return MIME_MAGIC_ERROR; } - } - break; + break; + case IS_RESOURCE: + { + php_stream *stream; + + php_stream_from_zval_no_verify(stream, &what); + if (php_stream_stat(stream, &stat_ssb)) { + if (MIME_MAGIC_G(debug)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-statable file path (%s)", Z_STRVAL_P(what)); + } + return MIME_MAGIC_ERROR; + } + } + break; + default: + return MIME_MAGIC_OK; } switch (stat_ssb.sb.st_mode & S_IFMT) { http://cvs.php.net/viewvc.cgi/php-src/ext/interbase/php_ibase_udf.c?r1=1.11&r2=1.12&diff_format=u Index: php-src/ext/interbase/php_ibase_udf.c diff -u php-src/ext/interbase/php_ibase_udf.c:1.11 php-src/ext/interbase/php_ibase_udf.c:1.12 --- php-src/ext/interbase/php_ibase_udf.c:1.11 Mon Jan 1 09:29:24 2007 +++ php-src/ext/interbase/php_ibase_udf.c Mon May 28 23:33:13 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ibase_udf.c,v 1.11 2007/01/01 09:29:24 sebastian Exp $ */ +/* $Id: php_ibase_udf.c,v 1.12 2007/05/28 23:33:13 iliaa Exp $ */ /** * This UDF library adds the ability to call PHP functions from SQL @@ -145,7 +145,7 @@ void exec_php(BLOBCALLBACK b, PARAMDSC *res, ISC_SHORT *init) { int result, remaining = b->blob_total_length, i = 0; - char *code = malloc(remaining+1); + char *code = pemalloc(remaining+1, 1); ISC_USHORT read; for (code[remaining] = '\0'; remaining > 0; remaining -= read) http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.238&r2=1.239&diff_format=u Index: php-src/ext/imap/php_imap.c diff -u php-src/ext/imap/php_imap.c:1.238 php-src/ext/imap/php_imap.c:1.239 --- php-src/ext/imap/php_imap.c:1.238 Sat Feb 24 16:25:53 2007 +++ php-src/ext/imap/php_imap.c Mon May 28 23:33:13 2007 @@ -26,7 +26,7 @@ | PHP 4.0 updates: Zeev Suraski <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_imap.c,v 1.238 2007/02/24 16:25:53 helly Exp $ */ +/* $Id: php_imap.c,v 1.239 2007/05/28 23:33:13 iliaa Exp $ */ #define IMAP41 @@ -2211,6 +2211,9 @@ if (dest.data) { free(dest.data); } + if (src.data) { + free(src.data); + } if (src.data && src.data != dest.data) { free(src.data); } @@ -2952,7 +2955,7 @@ BODY *bod=NULL, *topbod=NULL; PART *mypart=NULL, *part; PARAMETER *param, *disp_param = NULL, *custom_headers_param = NULL, *tmp_param = NULL; - char tmp[SENDBUFLEN + 1], *mystring=NULL, *t=NULL, *tempstring=NULL; + char *tmp=NULL, *mystring=NULL, *t=NULL, *tempstring=NULL; int toppart = 0; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &envelope, &body) == FAILURE) { @@ -3184,7 +3187,7 @@ disp_param->next = tmp_param; tmp_param = disp_param; } - bod->parameter = disp_param; + bod->parameter = disp_param; } } if (zend_hash_find(Z_ARRVAL_PP(data), "subtype", sizeof("subtype"), (void **) &pvalue)== SUCCESS) { @@ -3254,6 +3257,9 @@ } rfc822_encode_body_7bit(env, topbod); + + tmp = emalloc(SENDBUFLEN + 1); + rfc822_header(tmp, env, topbod); /* add custom envelope headers */ @@ -3303,7 +3309,7 @@ /* yucky default */ if (!cookie) { cookie = "-"; - } else if (strlen(cookie) > (sizeof(tmp) - 2 - 2)) { /* validate cookie length -- + CRLF */ + } else if (strlen(cookie) > (SENDBUFLEN - 2 - 2 - 2)) { /* validate cookie length -- + CRLF * 2 */ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The boudary should be no longer then 4kb"); RETVAL_FALSE; goto done; @@ -3311,18 +3317,14 @@ /* for each part */ do { - t=tmp; - /* build cookie */ - sprintf(t, "--%s%s", cookie, CRLF); - + t = tmp; + /* append mini-header */ + *t = '\0'; rfc822_write_body_header(&t, &part->body); - /* write terminating blank line */ - strcat(t, CRLF); - /* output cookie, mini-header, and contents */ - spprintf(&tempstring, 0, "%s%s", mystring, tmp); + spprintf(&tempstring, 0, "%s--%s%s%s%s", mystring, cookie, CRLF, tmp, CRLF); efree(mystring); mystring=tempstring; @@ -3334,13 +3336,13 @@ } while ((part = part->next)); /* until done */ /* output trailing cookie */ - spprintf(&tempstring, 0, "%s--%s--%s", mystring, tmp, CRLF); + spprintf(&tempstring, 0, "%s--%s--%s", mystring, cookie, CRLF); efree(mystring); mystring=tempstring; } else if (bod) { - spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data, CRLF); - efree(mystring); - mystring=tempstring; + spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data, CRLF); + efree(mystring); + mystring=tempstring; } else { efree(mystring); RETVAL_FALSE; @@ -3349,6 +3351,9 @@ RETVAL_STRING(tempstring, 0); done: + if (tmp) { + efree(tmp); + } mail_free_body(&topbod); mail_free_envelope(&env); } @@ -3889,7 +3894,7 @@ addresstmp = addresslist; if ((len = _php_imap_address_size(addresstmp))) { - tmpstr = (char *) malloc(len + 1); + tmpstr = (char *) pemalloc(len + 1, 1); tmpstr[0] = '\0'; rfc822_write_address(tmpstr, addresstmp); *fulladdress = tmpstr; @@ -4310,7 +4315,7 @@ } return NULL; } else { - char *buf = malloc(size + 1); + char *buf = pemalloc(size + 1, 1); if (f(stream, size, buf)) { buf[size] = '\0';
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php