[asterisk-bugs] [Asterisk 0014245]: SQLGetData returns no data
Asterisk Bug Tracker
noreply at bugs.digium.com
Wed Jan 14 22:28:29 CST 2009
The following issue has been SUBMITTED.
======================================================================
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: assigned
Asterisk Version: SVN
Regression: No
SVN Branch (only for SVN checkouts, not tarball releases): trunk
SVN Revision (number only!): 168053
Request Review:
======================================================================
Date Submitted: 2009-01-14 22:28 CST
Last Modified: 2009-01-14 22:28 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-14 22:28 dveiga New Issue
2009-01-14 22:28 dveiga Status new => assigned
2009-01-14 22:28 dveiga Assigned To => Corydon76
2009-01-14 22:28 dveiga Asterisk Version => SVN
2009-01-14 22:28 dveiga Regression => No
2009-01-14 22:28 dveiga SVN Branch (only for SVN checkouts, not tarball
releases) => trunk
2009-01-14 22:28 dveiga SVN Revision (number only!) => 168053
======================================================================
More information about the asterisk-bugs
mailing list