#48913 [NEW]: Too long error code strings in pdo_odbc driver
| From: | naf at altlinux dot ru | Date: | Tue, 14 Jul 2009 12:06:40 +0000 |
| Subject: | #48913 [NEW]: Too long error code strings in pdo_odbc driver | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-139718@lists.php.net to get a copy of this message | ||
From: naf at altlinux dot ru
Operating system: *
PHP version: 5.3CVS-2009-07-14 (snap)
PHP Bug Type: PDO related
Bug description: Too long error code strings in pdo_odbc driver
Description:
------------
In odbc_stmt.c, in functions odbc_stmt_set_param(), line 766 and
odbc_stmt_get_attr(), line 798, error code "IM0001" is placed in the
(pdo_odbc_stmt *)S->einfo.last_state.
The length of this error code string ("IM0001") is 7 bytes, but
last_state field declared as (php_pdo_odbc_int.h, line 121):
char last_state[6].
So buffer overflow will happen when executing
'strcpy(S->einfo.last_state, "IM0001")'.
Comparing to other PDO drivers it seems that error code should be 5
char in length, i.e. "IM001".
--
Edit bug report at http://bugs.php.net/?id=48913&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48913&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48913&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48913&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48913&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48913&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48913&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48913&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48913&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48913&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48913&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48913&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48913&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48913&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48913&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48913&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48913&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48913&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48913&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48913&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48913&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48913&r=mysqlcfg