[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_num_rows.phpt trunk/ext/mysqli/tests/mysqli_stmt_num_rows.phpt

2010-09-29 Thread Andrey Hristov
andrey   Wed, 29 Sep 2010 11:40:57 +

Revision: http://svn.php.net/viewvc?view=revision&revision=303854

Log:
fix the test

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_num_rows.phpt
U   php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_num_rows.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_num_rows.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_num_rows.phpt 
2010-09-29 09:24:24 UTC (rev 303853)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_num_rows.phpt 
2010-09-29 11:40:57 UTC (rev 303854)
@@ -27,17 +27,17 @@
function func_test_mysqli_stmt_num_rows($stmt, $query, $expected, 
$offset) {

if (!mysqli_stmt_prepare($stmt, $query)) {
-   printf("[%03d] [%d] %s\n", $offset, 
mysqli_stmt_errno($stmt), mysqli_error($stmt));
+   printf("[%03d] [%d] %s\n", $offset, 
mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
return false;
}

if (!mysqli_stmt_execute($stmt)) {
-   printf("[%03d] [%d] %s\n", $offset + 1, 
mysqli_errno($stmt), mysqli_error($stmt));
+   printf("[%03d] [%d] %s\n", $offset + 1, 
mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
return false;
}

if (!mysqli_stmt_store_result($stmt)) {
-   printf("[%03d] [%d] %s\n", $offset + 2, 
mysqli_errno($stmt), mysqli_error($stmt));
+   printf("[%03d] [%d] %s\n", $offset + 2, 
mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
return false;
}


Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_num_rows.phpt
===
--- php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_num_rows.phpt
2010-09-29 09:24:24 UTC (rev 303853)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_num_rows.phpt
2010-09-29 11:40:57 UTC (rev 303854)
@@ -27,17 +27,17 @@
function func_test_mysqli_stmt_num_rows($stmt, $query, $expected, 
$offset) {

if (!mysqli_stmt_prepare($stmt, $query)) {
-   printf("[%03d] [%d] %s\n", $offset, 
mysqli_stmt_errno($stmt), mysqli_error($stmt));
+   printf("[%03d] [%d] %s\n", $offset, 
mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
return false;
}

if (!mysqli_stmt_execute($stmt)) {
-   printf("[%03d] [%d] %s\n", $offset + 1, 
mysqli_errno($stmt), mysqli_error($stmt));
+   printf("[%03d] [%d] %s\n", $offset + 1, 
mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
return false;
}

if (!mysqli_stmt_store_result($stmt)) {
-   printf("[%03d] [%d] %s\n", $offset + 2, 
mysqli_errno($stmt), mysqli_error($stmt));
+   printf("[%03d] [%d] %s\n", $offset + 2, 
mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
return false;
}


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

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

2010-09-29 Thread Andrey Hristov
andrey   Wed, 29 Sep 2010 13:18:07 +

Revision: http://svn.php.net/viewvc?view=revision&revision=303855

Log:
Fix a problem that leads to leaks in plugins that
use stmt local data - no free is called for statements
that are over-prepared

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

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c   2010-09-29 
11:40:57 UTC (rev 303854)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c   2010-09-29 
13:18:07 UTC (rev 303855)
@@ -433,13 +433,19 @@
}

if (stmt_to_prepare != stmt) {
-   /* Free old buffers, binding and resources on server */
-   s->m->net_close(s, TRUE TSRMLS_CC);
-
-   memcpy(stmt, stmt_to_prepare, sizeof(MYSQLND_STMT_DATA));
-
-   /* Now we will have a clean new statement object */
-   mnd_pefree(stmt_to_prepare, stmt_to_prepare->persistent);
+   /* swap */
+   size_t real_size = sizeof(MYSQLND_STMT) + 
mysqlnd_plugin_count() * sizeof(void *);
+   char * tmp_swap = mnd_malloc(real_size);
+   memcpy(tmp_swap, s, real_size);
+   memcpy(s, s_to_prepare, real_size);
+   memcpy(s_to_prepare, tmp_swap, real_size);
+   mnd_free(tmp_swap);
+   {
+   MYSQLND_STMT_DATA * tmp_swap_data = stmt_to_prepare;
+   stmt_to_prepare = stmt;
+   stmt = tmp_swap_data;
+   }
+   s_to_prepare->m->dtor(s_to_prepare, TRUE TSRMLS_CC);
}
stmt->state = MYSQLND_STMT_PREPARED;
DBG_INF("PASS");

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c  2010-09-29 11:40:57 UTC (rev 
303854)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c  2010-09-29 13:18:07 UTC (rev 
303855)
@@ -433,13 +433,19 @@
}

if (stmt_to_prepare != stmt) {
-   /* Free old buffers, binding and resources on server */
-   s->m->net_close(s, TRUE TSRMLS_CC);
-
-   memcpy(stmt, stmt_to_prepare, sizeof(MYSQLND_STMT_DATA));
-
-   /* Now we will have a clean new statement object */
-   mnd_pefree(stmt_to_prepare, stmt_to_prepare->persistent);
+   /* swap */
+   size_t real_size = sizeof(MYSQLND_STMT) + 
mysqlnd_plugin_count() * sizeof(void *);
+   char * tmp_swap = mnd_malloc(real_size);
+   memcpy(tmp_swap, s, real_size);
+   memcpy(s, s_to_prepare, real_size);
+   memcpy(s_to_prepare, tmp_swap, real_size);
+   mnd_free(tmp_swap);
+   {
+   MYSQLND_STMT_DATA * tmp_swap_data = stmt_to_prepare;
+   stmt_to_prepare = stmt;
+   stmt = tmp_swap_data;
+   }
+   s_to_prepare->m->dtor(s_to_prepare, TRUE TSRMLS_CC);
}
stmt->state = MYSQLND_STMT_PREPARED;
DBG_INF("PASS");

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

[PHP-CVS] svn: /SVNROOT/ global_avail

2010-09-29 Thread Pierre Joye
pajoye   Wed, 29 Sep 2010 18:13:32 +

Revision: http://svn.php.net/viewvc?view=revision&revision=303877

Log:
- give Gustavo karma for php-src&co

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2010-09-29 16:53:17 UTC (rev 303876)
+++ SVNROOT/global_avail2010-09-29 18:13:32 UTC (rev 303877)
@@ -16,7 +16,7 @@
 # The PHP Developers have full access to the full source trees for
 # PHP, as well as the documentation.

-avail|patrickallaert,mgdm,pierrick,ilewis,mkoppanen,lstrojny,dharmap,kraghuba,stevseea,colder,lwe,auroraeosrose,mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,jani,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,!
 
tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe,scottmac,t2man,dsp,davidw,ab5602,nicholsr,lsmith,cellog,davidc,felipe,robinf,jmessa,philip,sixd,gwynne,ant,kalle,mattwil,sfox,hnangelo,ohill,indeyets,felixdv,mich4ld,lbarnaud,cseiler,sean,dkelsey,tabe,ericstewart,mbeccati,sebs,garretts,guenter,srinatar,basantk,geissert,salathe,aharvey,mj,gron,uw,fat|php/php-src,pecl,phpdoc,phd,web/doc,web/doc-editor
+avail|patrickallaert,mgdm,pierrick,ilewis,mkoppanen,lstrojny,dharmap,kraghuba,stevseea,colder,lwe,auroraeosrose,mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,jani,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,!
 
tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe,scottmac,t2man,dsp,davidw,ab5602,nicholsr,lsmith,cellog,davidc,felipe,robinf,jmessa,philip,sixd,gwynne,ant,kalle,mattwil,sfox,hnangelo,ohill,indeyets,felixdv,mich4ld,lbarnaud,cseiler,sean,dkelsey,tabe,ericstewart,mbeccati,sebs,garretts,guenter,srinatar,basantk,geissert,salathe,aharvey,mj,gron,uw,fat,cataphract|php/php-src,pecl,phpdoc,phd,web/doc,web/doc-editor

 # Engine karma is further restricted (this line MUST come after lines granting
 # php-src karma and before lines granting Zend/TSRM karma)
@@ -316,7 +316,6 @@
 avail|iekpo|pecl/solr,phpdoc
 avail|ruslany,ksingla,donraman|pecl/wincache,phpdoc
 avail|pierrick|pecl/stomp,phpdoc,php/php-src/branches/LEMON
-avail|cataphract|pecl/rar,phpdoc
 avail|cyberspice|pecl/dio,pecl/framegrab,phpdoc
 avail|crodas|pecl/textcat,phpdoc
 avail|dmendolia,patrickallaert,dragoonis|pecl/apm,phpdoc

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ NEWS ext/filter/logical_filters.c ext/filter/tests/bug52929.phpt

2010-09-29 Thread Adam Harvey
aharvey  Thu, 30 Sep 2010 02:35:37 +

Revision: http://svn.php.net/viewvc?view=revision&revision=303885

Log:
MFH: Fix for bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with
large amount of data).

Bug: http://bugs.php.net/52929 (Closed) Segfault in filter_var with 
FILTER_VALIDATE_EMAIL with large amount of data
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c
A + php/php-src/branches/PHP_5_2/ext/filter/tests/bug52929.phpt
(from php/php-src/trunk/ext/filter/tests/bug52929.phpt:r303779)

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-09-30 00:59:26 UTC (rev 303884)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-09-30 02:35:37 UTC (rev 303885)
@@ -4,6 +4,8 @@
 - Fixed possible flaw in open_basedir (CVE-2010-3436). (Pierre)
 - Fixed possible crash in mssql_fetch_batch(). (Kalle)

+- Fixed bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with
+  large amount of data). (Adam)
 - Fixed bug #52772 (var_dump() doesn't check for the existence of
   get_class_name before calling it). (Kalle, Gustavo)
 - Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values).

Modified: php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c
===
--- php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c   2010-09-30 
00:59:26 UTC (rev 303884)
+++ php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c   2010-09-30 
02:35:37 UTC (rev 303885)
@@ -531,6 +531,11 @@
int matches;


+   /* The maximum length of an e-mail address is 320 octets, per RFC 2821. 
*/
+   if (Z_STRLEN_P(value) > 320) {
+   RETURN_VALIDATION_FAILED
+   }
+
re = pcre_get_compiled_regex((char *)regexp, &pcre_extra, &preg_options 
TSRMLS_CC);
if (!re) {
RETURN_VALIDATION_FAILED

Copied: php/php-src/branches/PHP_5_2/ext/filter/tests/bug52929.phpt (from rev 
303779, php/php-src/trunk/ext/filter/tests/bug52929.phpt)
===
--- php/php-src/branches/PHP_5_2/ext/filter/tests/bug52929.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/filter/tests/bug52929.phpt 2010-09-30 
02:35:37 UTC (rev 303885)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with large 
amount of data)
+--SKIPIF--
+
+--FILE--
+-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php