php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14803 Call to SQLGetInfo in odbc_cursor gives empty cursor name
Submitted: 2002-01-02 12:18 UTC Modified: 2002-01-30 16:53 UTC
Votes:3
Avg. Score:3.7 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: steven dot gould at stevengould dot org Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.1.1 OS: Sybase ODBC (QNX and Win2k)
Private report: No CVE-ID:
 [2002-01-02 12:18 UTC] steven dot gould at stevengould dot org
This bug appears to have been in the code for several versions - definitely 4.0.5 through 4.1.1. In the odbc_cursor function (defined in ext/odbc/php_odbc.c), the call to SQLGetInfo (lines 1057-1058 in version 4.1.1 source code) uses a zero as the fourth parameter. This causes odbc_cursor to incorrectly return an empty cursor name, '' (when using different versions of Sybase SQL Anywhere under both QNX and Windows 2000).

The "bug" looks like it is more in the Sybase implementation of the ODBC SQLGetInfo documentation. According to the ODBC documentation, the fourth parameter is supposed to be ignored when the second parameter is set to an int type such as SQL_MAX_CURSOR_NAME_LEN.

The fix/workaround is to change the fourth parameter to:

  sizeof(max_len)

Can this fix be implemented in the base PHP code so that it works with the widest selection of ODBC drivers? Correct implementations should ignore this value. Thanks.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-30 16:53 UTC] kalowsky@php.net
as soon as my CVS finishes its connect, this should be done.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Thu Aug 17 11:01:43 2017 UTC