GNOME Bugzilla – Bug 323266
Crash when typing ' in field in details
Last modified: 2006-01-10 13:41:55 UTC
Distribution/Version: Ubuntu Vreezy Badgers Glom crashes immediately when a user enters some symbols (; and ' at least, there might be others) in a field.
Is this with the example? Could you be more precise about what exactly you are doing. Did you install Glom from Synaptic/Apt/etc?
I installed Glom from Synaptic, open the example database, entered some data to test it. All was fine. At one point, I entered some data (in the contact form, I believe) which contained a "'", and Glom just vanished. I have been able to reproduce this every time I entered "'" or ";".
Thanks.
I just had some time and tried this again. example: -entering "john'" as a first name in data mode in the Contacts table of the example database. -error message: "Internal Error ERROR: unterminated quoted string at or near "'john'', '', '', '', '', '', '', '', '', '', '', '', NULL, NULL, '', '', NULL)" at character 284" -Glom doesn't die -i click somewhere else, then click back on "john'", in order to take the "'" out. -Glom dies immediately. in some cases, though, Glom crashes before the error message is displayed.
I suspect that this is a failure in http://www.gnome-db.org/docs/libgda/libgda-GdaValue.html#gda-value-stringify (though it's never been clear what kind of string this should create - human readable or sql-ready). It's wrapped as Gda::Value::to_string() in C++. The new libgda branch has a more suitable method for this, though that branch has several other problems. In the meantime, we could do our own escaping in Field::sql(): http://cvs.gnome.org/viewcvs/glom/glom/data_structure/field.cc?view=markup
no idea. Programming is something I am totally ignorant about. :-(
Fixed in CVS, by escaping the strings, as suspected. Thanks for the bug report.