jakesylvestre / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

"Stack smashing" in GetDataString when accessing text column with size larger than 1024 chars #258

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Using an MS Access 2000 database with a text column with a value longer than 
1024 characters, the program will crash with the error message described below.
Changing line getdata.cpp:331 as follows:

  char tempBuffer[4096];

remedies the problem (for my data set). It is not clear to me whether the 
actual length of the value could be known beforehand to choose a buffer with an 
appropriate size.

What is the expected output? What do you see instead?

The program gets terminated with the following error message on leaving the 
function GetDataString:

*** stack smashing detected ***: 
/home/bb/eclipse-workspace/PhenoSys-doctool/virtualenv/bin/python terminated

Program received signal SIGSEGV, Segmentation fault.
0xb756cb19 in ?? () from /lib/i386-linux-gnu/libgcc_s.so.1

What version of the product are you using? On what operating system?
pyodbc:
  pyodbc          - 3.0.6-beta01 - active 

 (git commit. 7555f7da7d11b1dbe98895a8ce88df20d20a1006)

Operating System:
   Linux thinkpad 3.0.0-16-generic-pae #29-Ubuntu SMP Tue Feb 14 13:56:31 UTC 2012 i686 i686 i386 GNU/Linux

ODBC-related packages:

ii  libiodbc2                                      3.52.7-2                     
           iODBC Driver Manager
ii  libmdbodbc                                     
0.5.99.0.6pre1.0.20051109-7.1           MDB tools ODBC module
ii  libodbcinstq1c2                                2.2.14p2-2ubuntu1            
           Qt-based ODBC configuration library
ii  libvirtodbc0                                   6.1.3+dfsg1-1ubuntu1.1       
           high-performance database - ODBC libraries
ii  odbcinst                                       2.2.14p2-2ubuntu1            
           Helper program for accessing odbc ini files
ii  odbcinst1debian2                               2.2.14p2-2ubuntu1            
           Support library for accessing odbc ini files
rc  tdsodbc                                        0.82-7                       
           ODBC driver for connecting to MS SQL and Sybase SQL servers
ii  unixodbc                                       2.2.14p2-2ubuntu1            
           ODBC tools libraries
ii  unixodbc-bin                                   2.2.14p2-2ubuntu1            
           Graphical tools for ODBC management and browsing
ii  unixodbc-dev                                   2.2.14p2-2ubuntu1            
           ODBC libraries for UNIX (development files)

Please provide any additional information below.

Original issue reported on code.google.com by bernhard...@googlemail.com on 30 Apr 2012 at 11:46

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 29 Sep 2012 at 4:52