View Ticket
Not logged in
Ticket Hash: 89e186efa2f8622d85b89d84cda28bba8f763963
Title: CSV import/export fails on fields >= 65536 in spatialite_gui
Status: Fixed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2016-04-06 09:36:03
Version Found In: 4.4.0-dev
User Comments:
anonymous added on 2016-01-04 10:30:38:

A User who has attempted to import geometries (with hex-notation)

    that it failed where the field was > 65536
See: error of loading geometry data from csv file to Spatialite
It was later mentioned that he could import these files with SQLitestudio 3.0.7
Looking at the code in
    TextCsv.cpp MyFrame::LoadText and
    Shapefiles.cpp MyFrame::CleanSqlString
I saw that the field values are being stored in a char dummy/new_value[65536].
The crash probably occurs at the strcpy(dummy, value);
    since the reserved space is to small

While working on a alternative solution, I also attempted to export a big result, which caused the application to crash.
I assume that this was in Shapefiles.cpp:ExportResultSetAsTxtTab
    that also has a definition of char dummy[65536];

For text fields
    char dummy[65536]; should not be used
      since the size (in cases such as exporting binary fields) needs to be determined
      being replace with a dynamic allocation, being freed afterwords

Could you create an account with the same user-name and password as for the RasterLite2 project?
Mark