Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-12-12 Thread Nuno Lopes
I've commited a little fix to *printf() functions, so that they won't read 
past the specified length.

Nuno


- Original Message -
It does not really read past it, but internally it does a strlen() on  the 
%s argument, which is where the valgrind shows the message.  Technically 
that code needs to be reviewed, but just from general use  case I think 
its safer not to pass non-terminated char pointers around.



On 11-Dec-08, at 11:50 AM, Nuno Lopes wrote:

Weird.. Isn't that a bug in php_stream_printf() then? I would say it 
shouldn't read past the specified length.. otherwise the same bug  may 
appear in other places.

What do you think?

Nuno

- Original Message -
The patch was already n 5.2, the issue is that the str (key) is not 
guaranteed to be NULL terminated (nor does it need to be), so when 
strlen() is attempted on top of it you could end up reading more  data 
then necessary.



On 11-Dec-08, at 10:43 AM, Nuno Lopes wrote:


Modified files:  (Branch: PHP_5_3)
 /php-src/ext/pdo pdo_stmt.c
Log:
Fixed a possible corruption inside PDOStatement::debugDumpParams()


http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ ext/ 
pdo/pdo_stmt.c:1.118.2.38.2.24.2.40

@@ -2209,7 +2209,9 @@
if (res == HASH_KEY_IS_LONG) {
php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num);
} else if (res == HASH_KEY_IS_STRING) {
- php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n,  len, 
len, str);

+ char *s = estrndup(str, len);
+ php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n,  len, 
len, s);

+ efree(s);
}


Sorry for my ignorance, but isn't the new code exactly equivalent  to 
the old one, albeit a bit slower?  I can't really see how a   strndup() 
can fix a corruption there.. If there's some problem,   probably it's 
deeper than this..

Nuno


Ilia Alshanetsky 



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-12-11 Thread Nuno Lopes

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/pdo pdo_stmt.c
 Log:
 Fixed a possible corruption inside PDOStatement::debugDumpParams()


http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 
php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.40

@@ -2209,7 +2209,9 @@
 if (res == HASH_KEY_IS_LONG) {
 php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num);
 } else if (res == HASH_KEY_IS_STRING) {
- php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, 
str);

+ char *s = estrndup(str, len);
+ php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, s);
+ efree(s);
 }


Sorry for my ignorance, but isn't the new code exactly equivalent to the old 
one, albeit a bit slower?  I can't really see how a strndup() can fix a 
corruption there.. If there's some problem, probably it's deeper than this..
Nuno 



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-12-11 Thread Ilia Alshanetsky
The patch was already n 5.2, the issue is that the str (key) is not  
guaranteed to be NULL terminated (nor does it need to be), so when  
strlen() is attempted on top of it you could end up reading more data  
then necessary.



On 11-Dec-08, at 10:43 AM, Nuno Lopes wrote:


Modified files:  (Branch: PHP_5_3)
  /php-src/ext/pdo pdo_stmt.c
Log:
Fixed a possible corruption inside PDOStatement::debugDumpParams()


http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ext/ 
pdo/pdo_stmt.c:1.118.2.38.2.24.2.40

@@ -2209,7 +2209,9 @@
if (res == HASH_KEY_IS_LONG) {
php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num);
} else if (res == HASH_KEY_IS_STRING) {
- php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len,  
len, str);

+ char *s = estrndup(str, len);
+ php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len,  
len, s);

+ efree(s);
}


Sorry for my ignorance, but isn't the new code exactly equivalent to  
the old one, albeit a bit slower?  I can't really see how a  
strndup() can fix a corruption there.. If there's some problem,  
probably it's deeper than this..

Nuno


Ilia Alshanetsky





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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-12-11 Thread Nuno Lopes
Weird.. Isn't that a bug in php_stream_printf() then? I would say it 
shouldn't read past the specified length.. otherwise the same bug may appear 
in other places.

What do you think?

Nuno

- Original Message -
The patch was already n 5.2, the issue is that the str (key) is not 
guaranteed to be NULL terminated (nor does it need to be), so when 
strlen() is attempted on top of it you could end up reading more data 
then necessary.



On 11-Dec-08, at 10:43 AM, Nuno Lopes wrote:


Modified files:  (Branch: PHP_5_3)
  /php-src/ext/pdo pdo_stmt.c
Log:
Fixed a possible corruption inside PDOStatement::debugDumpParams()


http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ext/ 
pdo/pdo_stmt.c:1.118.2.38.2.24.2.40

@@ -2209,7 +2209,9 @@
if (res == HASH_KEY_IS_LONG) {
php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num);
} else if (res == HASH_KEY_IS_STRING) {
- php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len,  len, 
str);

+ char *s = estrndup(str, len);
+ php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len,  len, 
s);

+ efree(s);
}


Sorry for my ignorance, but isn't the new code exactly equivalent to  the 
old one, albeit a bit slower?  I can't really see how a  strndup() can 
fix a corruption there.. If there's some problem,  probably it's deeper 
than this..

Nuno


Ilia Alshanetsky 



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-12-11 Thread Ilia Alshanetsky
It does not really read past it, but internally it does a strlen() on  
the %s argument, which is where the valgrind shows the message.  
Technically that code needs to be reviewed, but just from general use  
case I think its safer not to pass non-terminated char pointers around.



On 11-Dec-08, at 11:50 AM, Nuno Lopes wrote:

Weird.. Isn't that a bug in php_stream_printf() then? I would say it  
shouldn't read past the specified length.. otherwise the same bug  
may appear in other places.

What do you think?

Nuno

- Original Message -
The patch was already n 5.2, the issue is that the str (key) is not  
guaranteed to be NULL terminated (nor does it need to be), so when  
strlen() is attempted on top of it you could end up reading more  
data then necessary.



On 11-Dec-08, at 10:43 AM, Nuno Lopes wrote:


Modified files:  (Branch: PHP_5_3)
 /php-src/ext/pdo pdo_stmt.c
Log:
Fixed a possible corruption inside PDOStatement::debugDumpParams()


http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ 
ext/ pdo/pdo_stmt.c:1.118.2.38.2.24.2.40

@@ -2209,7 +2209,9 @@
if (res == HASH_KEY_IS_LONG) {
php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num);
} else if (res == HASH_KEY_IS_STRING) {
- php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n,  
len,  len, str);

+ char *s = estrndup(str, len);
+ php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n,  
len,  len, s);

+ efree(s);
}


Sorry for my ignorance, but isn't the new code exactly equivalent  
to  the old one, albeit a bit slower?  I can't really see how a   
strndup() can fix a corruption there.. If there's some problem,   
probably it's deeper than this..

Nuno


Ilia Alshanetsky




Ilia Alshanetsky





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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-10-24 Thread Felipe Pena
Hello Marcus,

2008/10/11 Marcus Boerger [EMAIL PROTECTED]:
 Hello Felipe,

  why did we not put that 'static' into the macro?

 marcus
 Friday, October 10, 2008, 9:35:34 PM, you wrote:

 felipe  Fri Oct 10 19:35:34 2008 UTC

   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/pdopdo_stmt.c
   Log:
   - MFH: Static'fication


Done!

-- 
Regards,
Felipe Pena.

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-10-11 Thread Marcus Boerger
Hello Felipe,

  why did we not put that 'static' into the macro?

marcus
Friday, October 10, 2008, 9:35:34 PM, you wrote:

 felipe  Fri Oct 10 19:35:34 2008 UTC

   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/pdopdo_stmt.c 
   Log:
   - MFH: Static'fication
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.24r2=1.118.2.38.2.24.2.25diff_format=u
 Index: php-src/ext/pdo/pdo_stmt.c
 diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.24
 php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.25
 --- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.24 Fri Oct 10 16:47:15 
 2008
 +++ php-src/ext/pdo/pdo_stmt.c  Fri Oct 10 19:35:34 2008
 @@ -18,7 +18,7 @@
+--+
  */
  
 -/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.24 2008/10/10 16:47:15 felipe Exp $ */
 +/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.25 2008/10/10 19:35:34 felipe Exp $ */
  
  /* The PDO Statement Handle Class */
  
 @@ -38,31 +38,44 @@
  #include php_memory_streams.h
  
  /* {{{ arginfo */
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_execute, 0, 0, 0)
 ZEND_ARG_INFO(0, bound_input_params) /* array */
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetch, 0, 0, 0)
 ZEND_ARG_INFO(0, how)
 ZEND_ARG_INFO(0, orientation)
 ZEND_ARG_INFO(0, offset)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetchobject, 0, 0, 0)
 ZEND_ARG_INFO(0, class_name)
 ZEND_ARG_INFO(0, ctor_args) /* array */
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetchcolumn, 0, 0, 0)
 ZEND_ARG_INFO(0, column_number)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_fetchall, 0, 0, 0)
 ZEND_ARG_INFO(0, how)
 ZEND_ARG_INFO(0, class_name)
 ZEND_ARG_INFO(0, ctor_args) /* array */
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_bindvalue, 0, 0, 2)
 ZEND_ARG_INFO(0, paramno)
 ZEND_ARG_INFO(0, param)
 ZEND_ARG_INFO(0, type)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_bindparam, 0, 0, 2)
 ZEND_ARG_INFO(0, paramno)
 ZEND_ARG_INFO(1, param)
 @@ -70,6 +83,8 @@
 ZEND_ARG_INFO(0, maxlen)
 ZEND_ARG_INFO(0, driverdata)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_bindcolumn, 0, 0, 2)
 ZEND_ARG_INFO(0, column)
 ZEND_ARG_INFO(1, param)
 @@ -77,16 +92,24 @@
 ZEND_ARG_INFO(0, maxlen)
 ZEND_ARG_INFO(0, driverdata)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO(arginfo_pdostatement_setattribute, 0)
 ZEND_ARG_INFO(0, attribute)
 ZEND_ARG_INFO(0, value)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO(arginfo_pdostatement_getattribute, 0)
 ZEND_ARG_INFO(0, attribute)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO(arginfo_pdostatement_getcolumnmeta, 0)
 ZEND_ARG_INFO(0, column)
  ZEND_END_ARG_INFO()
 +
 +static
  ZEND_BEGIN_ARG_INFO_EX(arginfo_pdostatement_setfetchmode, 0, 0, 1)
 ZEND_ARG_INFO(0, mode)
 ZEND_ARG_INFO(0, params)






Best regards,
 Marcus


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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2008-10-11 Thread Felipe Pena
Hello Marcus,

Em Sáb, 2008-10-11 às 20:48 +0200, Marcus Boerger escreveu: 
 Hello Felipe,
 
   why did we not put that 'static' into the macro?
 

I think that would be nice. But will requires massive changes, as there
is tons of code like that. Though it isn't an impediment. :)


-- 
Regards,
Felipe Pena


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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c /ext/phar phar.phar /main php_ini.c php_ini.h ZendEngine2 zend.c zend.h zend_API.c zend_API.h zend_compile.c zend_compile.h zend_constants.c zen

2008-08-13 Thread Pierre Joye
2008/8/12 Felipe Pena [EMAIL PROTECTED]:
 felipe  Tue Aug 12 17:20:26 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2zend.c zend.h zend_API.c zend_API.h zend_compile.c
zend_compile.h zend_constants.c zend_constants.h
zend_execute.c zend_execute.h zend_extensions.c
zend_extensions.h zend_hash.c zend_hash.h
zend_modules.h zend_object_handlers.c
zend_object_handlers.h zend_objects.c zend_objects.h
zend_objects_API.c zend_objects_API.h zend_operators.c
zend_operators.h zend_stack.c zend_stack.h
/php-src/ext/pdopdo_stmt.c
/php-src/ext/phar   phar.phar
/php-src/main   php_ini.c php_ini.h
  Log:
  - MFH: Constness (Added const qualifier to several function parameters)

That breaks the windows build:

zend_API.c
Zend\zend_API.c(317) : error C2166: l-value specifies const object
Zend\zend_API.c(351) : error C2166: l-value specifies const object
Zend\zend_API.c(385) : error C2166: l-value specifies const object
Zend\zend_API.c(386) : error C2166: l-value specifies const object
Zend\zend_API.c(420) : error C2166: l-value specifies const object
Zend\zend_API.c(442) : error C2166: l-value specifies const object
Zend\zend_API.c(457) : error C2166: l-value specifies const object
Zend\zend_API.c(472) : error C2166: l-value specifies const object
Zend\zend_API.c(487) : error C2166: l-value specifies const object
Zend\zend_API.c(502) : error C2166: l-value specifies const object
Zend\zend_API.c(503) : error C2166: l-value specifies const object
Zend\zend_API.c(524) : error C2166: l-value specifies const object
Zend\zend_API.c(557) : error C2166: l-value specifies const object
Zend\zend_API.c(558) : error C2166: l-value specifies const object
Zend\zend_API.c(590) : error C2166: l-value specifies const object
Zend\zend_API.c(601) : error C2166: l-value specifies const object
Zend\zend_API.c(765) : error C2166: l-value specifies const object
Zend\zend_API.c(766) : error C2166: l-value specifies const object
zend_alloc.c


Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c /ext/phar phar.phar /main php_ini.c php_ini.h ZendEngine2 zend.c zend.h zend_API.c zend_API.h zend_compile.c zend_compile.h zend_constants.c zen

2008-08-13 Thread Felipe Pena
Em Qua, 2008-08-13 às 17:58 +0200, Pierre Joye escreveu:
 2008/8/12 Felipe Pena [EMAIL PROTECTED]:
  felipe  Tue Aug 12 17:20:26 2008 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /ZendEngine2zend.c zend.h zend_API.c zend_API.h zend_compile.c
 zend_compile.h zend_constants.c zend_constants.h
 zend_execute.c zend_execute.h zend_extensions.c
 zend_extensions.h zend_hash.c zend_hash.h
 zend_modules.h zend_object_handlers.c
 zend_object_handlers.h zend_objects.c zend_objects.h
 zend_objects_API.c zend_objects_API.h 
  zend_operators.c
 zend_operators.h zend_stack.c zend_stack.h
 /php-src/ext/pdopdo_stmt.c
 /php-src/ext/phar   phar.phar
 /php-src/main   php_ini.c php_ini.h
   Log:
   - MFH: Constness (Added const qualifier to several function parameters)
 
 That breaks the windows build:
 
 zend_API.c
 Zend\zend_API.c(317) : error C2166: l-value specifies const object
 Zend\zend_API.c(351) : error C2166: l-value specifies const object
 Zend\zend_API.c(385) : error C2166: l-value specifies const object
 Zend\zend_API.c(386) : error C2166: l-value specifies const object
 Zend\zend_API.c(420) : error C2166: l-value specifies const object
 Zend\zend_API.c(442) : error C2166: l-value specifies const object
 Zend\zend_API.c(457) : error C2166: l-value specifies const object
 Zend\zend_API.c(472) : error C2166: l-value specifies const object
 Zend\zend_API.c(487) : error C2166: l-value specifies const object
 Zend\zend_API.c(502) : error C2166: l-value specifies const object
 Zend\zend_API.c(503) : error C2166: l-value specifies const object
 Zend\zend_API.c(524) : error C2166: l-value specifies const object
 Zend\zend_API.c(557) : error C2166: l-value specifies const object
 Zend\zend_API.c(558) : error C2166: l-value specifies const object
 Zend\zend_API.c(590) : error C2166: l-value specifies const object
 Zend\zend_API.c(601) : error C2166: l-value specifies const object
 Zend\zend_API.c(765) : error C2166: l-value specifies const object
 Zend\zend_API.c(766) : error C2166: l-value specifies const object
 zend_alloc.c
 

Ouch. I commited a possible fix. Try it please.

Thanks.

 
 Cheers,
-- 
Regards,
Felipe Pena.


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



RE: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2007-11-20 Thread Dmitry Stogov
Hi Ilia,

After this fix 39 PDO rleated test are failed for me :(

SIGSEGV

#0  0x083430e9 in _zend_is_inconsistent (ht=0x0,
file=0x849721c /home/dmitry/php/php5.3/Zend/zend_hash.c, line=1015)
at /home/dmitry/php/php5.3/Zend/zend_hash.c:53
#1  0x08345d73 in zend_hash_num_elements (ht=0x0)
at /home/dmitry/php/php5.3/Zend/zend_hash.c:1015
#2  0x081541b7 in dispatch_param_event (stmt=0x8780354,
event_type=PDO_PARAM_EVT_EXEC_PRE)
at /home/dmitry/php/php5.3/ext/pdo/pdo_stmt.c:171
#3  0x08155122 in zim_PDOStatement_execute (ht=0, return_value=0x8788f04,
return_value_ptr=0x0, this_ptr=0x877c6bc, return_value_used=0)
at /home/dmitry/php/php5.3/ext/pdo/pdo_stmt.c:499
#4  0x0835f37c in zend_do_fcall_common_helper_SPEC (execute_data=0xbfbfe9ac)
at /home/dmitry/php/php5.3/Zend/zend_vm_execute.h:190
#5  0x08360097 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfe9ac)
at /home/dmitry/php/php5.3/Zend/zend_vm_execute.h:308
#6  0x0835ee82 in execute (op_array=0x877c164)
at /home/dmitry/php/php5.3/Zend/zend_vm_execute.h:86
#7  0x08337dee in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /home/dmitry/php/php5.3/Zend/zend.c:1139
#8  0x082dff29 in php_execute_script (primary_file=0xbfc00d30)
at /home/dmitry/php/php5.3/main/main.c:2007
#9  0x083bf974 in main (argc=2, argv=0xbfc00e84)
at /home/dmitry/php/php5.3/sapi/cli/php_cli.c:1140

Dmitry.

 -Original Message-
 From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, November 20, 2007 5:22 PM
 To: php-cvs@lists.php.net
 Subject: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c 
 
 
 iliaa Tue Nov 20 14:22:27 2007 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/pdo  pdo_stmt.c 
   Log:
   Fixed bug #42978 (mismatch between number of bound params 
 and values causes
   a crash in pdo_pgsql)
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.
118.2.38.2.24.2.5r2=1.118.2.38.2.24.2.6diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.5
php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.6
--- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.5  Wed Oct 31 12:57:51
2007
+++ php-src/ext/pdo/pdo_stmt.c  Tue Nov 20 14:22:27 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.5 2007/10/31 12:57:51 iliaa Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.6 2007/11/20 14:22:27 iliaa Exp 
+$ */
 
 /* The PDO Statement Handle Class */
 
@@ -168,6 +168,11 @@
 
 iterate:
if (ht) {
+   if (zend_hash_num_elements(stmt-bound_param_map) !=
zend_hash_num_elements(ht)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Number
of bound paramters %d does not match number of bound values %d,
zend_hash_num_elements(stmt-bound_param_map), zend_hash_num_elements(ht));
+   return 0;   
+   }
+
zend_hash_internal_pointer_reset(ht);
while (SUCCESS == zend_hash_get_current_data(ht,
(void**)param)) {
if (!stmt-methods-param_hook(stmt, param,
event_type TSRMLS_CC)) {

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

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2007-11-20 Thread Antony Dovgal
On 21.11.2007 00:14, Dmitry Stogov wrote:
 Hi Ilia,
 
 After this fix 39 PDO rleated test are failed for me :(

Confirmed.

Pay attention to `ht` value here:
(gdb) bt
#0  0x008c0e87 in _zend_is_inconsistent (ht=0x0, file=0xc22098 
/local/qa/5_3/Zend/zend_hash.c, line=1015) at 
/local/qa/5_3/Zend/zend_hash.c:53
#1  0x008c3f9f in zend_hash_num_elements (ht=0x0) at 
/local/qa/5_3/Zend/zend_hash.c:1015


-- 
Wbr, 
Antony Dovgal

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c

2007-11-20 Thread Ilia Alshanetsky

I am looking into it now.


On 20-Nov-07, at 4:21 PM, Antony Dovgal wrote:


On 21.11.2007 00:14, Dmitry Stogov wrote:

Hi Ilia,

After this fix 39 PDO rleated test are failed for me :(


Confirmed.

Pay attention to `ht` value here:
(gdb) bt
#0  0x008c0e87 in _zend_is_inconsistent (ht=0x0,  
file=0xc22098 /local/qa/5_3/Zend/zend_hash.c, line=1015) at /local/ 
qa/5_3/Zend/zend_hash.c:53
#1  0x008c3f9f in zend_hash_num_elements (ht=0x0) at /local/ 
qa/5_3/Zend/zend_hash.c:1015



--
Wbr,
Antony Dovgal


Ilia Alshanetsky

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