[asterisk-bugs] [Asterisk 0014245]: SQLGetData returns no data

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jan 15 12:39:57 CST 2009


The following issue has been RESOLVED. 
====================================================================== 
http://bugs.digium.com/view.php?id=14245 
====================================================================== 
Reported By:                dveiga
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   14245
Category:                   Functions/func_odbc
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 168053 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-01-14 22:28 CST
Last Modified:              2009-01-15 12:39 CST
====================================================================== 
Summary:                    SQLGetData returns no data
Description: 
When ast_str_SQLGetData() is called with maxlen<0, it simply calls
SQLGetData() passing maxlen as the buffer length. As it is negative,
SQLGetData() returns SQL_SUCCESS_WITH_INFO indicating the data doesn´t fit
into the buffer and no data is returned. When I got to this point I was
happy, I thought the problem could be easily solved using the actual buffer
length (held in the __AST_STR_LEN field) instead of maxlen when calling
SQLGetData().

But when I did so I stuck into a bigger problem: In my platform (Fedora
Linux  2.6.26.5-45.fc9.x86_64), size_t seems to be unsigned!!! This causes
the comparison 'maxlen>0' inside ast_str_SQLGetData() to be always true and
ast_str_make_space() getting called to allocate a buffer for it.

I can still work on the problem, but as it might involve bigger changes
like changing types I prefer to listen to your comments first.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-15 12:39 svnbot         Status                   assigned => resolved
2009-01-15 12:39 svnbot         Resolution               open => fixed       
======================================================================




More information about the asterisk-bugs mailing list