PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO

Bug #61212 PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO
Submitted: 2012-02-29 19:21 UTC Modified: 2012-03-14 20:20 UTC
From: anilvarghese25 at gmail dot com Assigned: iliaa (profile)
Status: Closed Package: PDO related
PHP Version: 5.3.10 OS: Linux
Private report: No CVE-ID: None

 [2012-02-29 19:21 UTC] anilvarghese25 at gmail dot com

Description:
------------
PDO ODBC segfaults when a column less than 256 bytes are retrieved (has to be SUCCESS_WITH_INFO). The buffer is allocated with the assumption the retrieved column is greater than 256 bytes. When a column with say 150 bytes are allocated, the code tries to write 256 bytes to the buffer and results in a segfault.

The segfaults go away by ensuring the column length is checked before assigning characters to the buffer.  

Test script:
---------------
<requires a column coming from the db with a character encoding issue and length less than 256>




Expected result:
----------------
Should work regardless of the length of the column data

Actual result:
--------------
Segmentation Fault

Patches

Segfault_fix_for_pdo_odbc (last revision 2012-02-29 19:21 UTC by anilvarghese25 at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2012-03-14 20:20 UTC] iliaa@php.net

-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa