php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65952 Invalid buffer position in Prepared Statement
Submitted: 2013-10-23 15:36 UTC Modified: 2020-10-11 04:22 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: wils dot solutions at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: PDO ODBC
PHP Version: 5.4.21 OS: Centos6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wils dot solutions at gmail dot com
New email:
PHP Version: OS:

 

 [2013-10-23 15:36 UTC] wils dot solutions at gmail dot com
Description:
------------
I was trying to use PDO_ODBC with HP Vertica but it returns the "Invalid buffer position" error.

I don't have this problem using ODBC Functions and I am using it now instead of PDO_ODBC but decided to report the issue anyways...

By looking at the ODBC trace files, I see that when pdo_odbc binds parameter, it always sets the BufferLength argument of the SQLBindParameter() function to 0. I believe this is wrong, since the input is a character type, and as a result there is a buffer overrun.

Test script:
---------------
$query = "select * from category where name = :nome";        
$sth = $this->_lnk->prepare($query);        
$category = 'Hardcore';        
$sth->bindParam(':nome', $category);        
$sth->execute();

Expected result:
----------------
The query result

Actual result:
--------------
Fails with error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 50240 [Vertica][Support] (50240) Invalid buffer position. (SQLExecute[50240] at /builddir/build/BUILD/php-5.4.21/ext/pdo_odbc/odbc_stmt.c:254)' in /admin_vertica_report.class.php on line 39


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:27 UTC] felipe@php.net
-Package: PDO related +Package: PDO ODBC
 [2020-09-28 14:04 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-09-28 14:04 UTC] cmb@php.net
Can anybody reproduce this with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2020-10-11 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 22:01:23 2020 UTC