Bug 981060

Summary: Bad coverity patch
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: unixODBCAssignee: Honza Horak <hhorak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 19CC: hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: unixODBC-2.3.1-6.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-16 01:45:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sam Varshavchik 2013-07-03 22:23:34 UTC
Description of problem:

coverity-fixes.patch broke SQLGetCursorName() and SQLGetCursorNameW().

Version-Release number of selected component (if applicable):

unixODBC-2.3.1-4.fc19

How reproducible:

Always

Steps to Reproduce:
1. Use SQLGetCursorName(), as documented in ODBC API

Actual results:

The function call always fails.

Expected results:

Should not fail.

Additional info:

The following patch was applied to both SQLGetCursorName() and SQLGetCursorNameW().

-    if ( !buffer_length < 0 )
+    if ( !(buffer_length < 0) )

The correct fix that should've been applied (in both cases):

-    if ( !buffer_length < 0 )
+    if ( buffer_length < 0 )

This is obvious just by looking at the code. It should be erroring out when the output buffer size parameter value is negative (zero value is permissible, according to ODBC documentation).

Comment 1 Honza Horak 2013-07-04 10:03:34 UTC
Thanks for reporting, really a silly mistake, I'll fix in a minute.

Comment 2 Fedora Update System 2013-07-04 12:20:44 UTC
unixODBC-2.3.1-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/unixODBC-2.3.1-6.fc19

Comment 3 Fedora Update System 2013-07-05 01:54:43 UTC
Package unixODBC-2.3.1-6.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing unixODBC-2.3.1-6.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-12307/unixODBC-2.3.1-6.fc19
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-07-16 01:45:56 UTC
unixODBC-2.3.1-6.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.