tracker r2134 - in branches/indexer-split: . src/libtracker-db
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2134 - in branches/indexer-split: . src/libtracker-db
- Date: Thu, 21 Aug 2008 14:22:37 +0000 (UTC)
Author: mottela
Date: Thu Aug 21 14:22:37 2008
New Revision: 2134
URL: http://svn.gnome.org/viewvc/tracker?rev=2134&view=rev
Log:
Added row checking for result_set_get_value to prevent crashing
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-db/tracker-db-interface.c
Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface.c Thu Aug 21 14:22:37 2008
@@ -520,7 +520,22 @@
if (priv->col_types[column] != G_TYPE_INVALID) {
g_value_init (value, priv->col_types[column]);
- fill_in_value (value, row[column]);
+ if (row) {
+ fill_in_value (value, row[column]);
+ } else {
+ /* Make up some empty value. */
+ switch (G_VALUE_TYPE (value)) {
+ case G_TYPE_INT:
+ g_value_set_int (value, 0);
+ break;
+ case G_TYPE_DOUBLE:
+ g_value_set_double (value, 0.0);
+ break;
+ case G_TYPE_STRING:
+ g_value_set_string (value, "");
+ break;
+ }
+ }
} else {
/* Make up some empty value */
g_value_init (value, G_TYPE_STRING);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]