[Libreoffice-bugs] [Bug 50849] SIGSEGV: ODBC to PostgreSQL, renaming column in SELECT list

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 10 10:38:07 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=50849

--- Comment #10 from Terrence Enger <lo_bugs at iseries-guru.com> 2012-07-10 01:38:07 PDT ---
My references to the ODBC driver are to psqlodbc-09.01.0100.


It is the ODBC driver which dereferences the null pointer, and the ODBC
driver may be the underlying cause.  Still, I suggest that between the
cause and the dereference, LibreOffice has at least helped the ODBC
driver to fail by executing a "funny" call.

In the segfaulting case, ODatabaseMetDataResultSet::openSpecialColumns,
ODatabaseMetaDataResultSet.cxx:1139, calls SQLSpecialColumns with null
string and zero for parameters 7 and 8, TableName and TableNameSize.
For comparison, in the working case, LibreOffice passes a good table
name (and good catalog name and schema name, too).
<msdn.microsoft.com/en-us/library/windows/desktop/ms714602(v=vs.85).aspx>
does not mention the possibility of the table name being the null
string.  I cannot imagine how one could expect a good result from the
null string.

Does this suggest that it would be good to look into why LO is doing the
call with null table name?  Or into why LO is doing this extra call at
all?


A funny thing happened on the way to the crash: In PGAPI_SpecialColumns,
info.c line 2783 detects the null table name, so line 2785 does
SC_set_error and then line 2786 returns SQL_SUCCESS.  SQL_SUCCESS sounds
to me like an outright lie.  If in SQLSPecialColumns I fudge the return
value to SQL_ERROR, then LibreOffice ...

(*) Goes on to call SQLSpecialColumns with good catalog, schema, and
    table names.  This call looks very much like what I remember from
    the successful query.

(*) Goes on to display the table data.

The SQL_SUCCESS sounds to me like a candidate for reporting upstream, as
does the segfault itself.  LEM, do you agree?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Libreoffice-bugs mailing list