After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 323266 - Crash when typing ' in field in details
Crash when typing ' in field in details
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: data mode
0.9.x
Other Linux
: Normal major
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2005-12-05 13:18 UTC by Nicolas Chevreux
Modified: 2006-01-10 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nicolas Chevreux 2005-12-05 13:18:09 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.
Comment 1 Murray Cumming 2005-12-05 14:10:10 UTC
Is this with the example? Could you be more precise about what exactly you are
doing. Did you install Glom from Synaptic/Apt/etc?
Comment 2 Nicolas Chevreux 2005-12-05 14:17:29 UTC
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 ";".
Comment 3 Murray Cumming 2005-12-05 14:35:56 UTC
Thanks.
Comment 4 Nicolas Chevreux 2005-12-05 15:49:38 UTC
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.
Comment 5 Murray Cumming 2005-12-05 15:55:41 UTC
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
Comment 6 Nicolas Chevreux 2005-12-05 17:12:08 UTC
no idea. Programming is something I am totally ignorant about. :-(
Comment 7 Murray Cumming 2006-01-10 13:41:55 UTC
Fixed in CVS, by escaping the strings, as suspected. Thanks for the bug report.