[tracker/binary-log-2: 24/42] libtracker-db: Add more checks to tracker_db_journal_append_*



commit 89ccc0fdf44d08052f24303ca6f41378264c1682
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jan 6 15:10:56 2010 +0100

    libtracker-db: Add more checks to tracker_db_journal_append_*

 src/libtracker-db/tracker-db-journal.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 1469ecf..735c266 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -326,6 +326,9 @@ tracker_db_journal_append_delete_statement (guint32      s_id,
 	gint size;
 
 	g_return_val_if_fail (writer.journal > 0, FALSE);
+	g_return_val_if_fail (s_id > 0, FALSE);
+	g_return_val_if_fail (p_id > 0, FALSE);
+	g_return_val_if_fail (object != NULL, FALSE);
 
 	o_len = strlen (object);
 	df = DATA_FORMAT_OPERATION_DELETE;
@@ -354,6 +357,9 @@ tracker_db_journal_append_delete_statement_id (guint32 s_id,
 	gint size;
 
 	g_return_val_if_fail (writer.journal > 0, FALSE);
+	g_return_val_if_fail (s_id > 0, FALSE);
+	g_return_val_if_fail (p_id > 0, FALSE);
+	g_return_val_if_fail (o_id > 0, FALSE);
 
 	df = DATA_FORMAT_OPERATION_DELETE | DATA_FORMAT_OBJECT_ID;
 	size = sizeof (guint32) * 4;
@@ -381,6 +387,9 @@ tracker_db_journal_append_insert_statement (guint32      s_id,
 	gint size;
 
 	g_return_val_if_fail (writer.journal > 0, FALSE);
+	g_return_val_if_fail (s_id > 0, FALSE);
+	g_return_val_if_fail (p_id > 0, FALSE);
+	g_return_val_if_fail (object != NULL, FALSE);
 
 	o_len = strlen (object);
 	df = 0x00;
@@ -408,6 +417,9 @@ tracker_db_journal_append_insert_statement_id (guint32 s_id,
 	gint size;
 
 	g_return_val_if_fail (writer.journal > 0, FALSE);
+	g_return_val_if_fail (s_id > 0, FALSE);
+	g_return_val_if_fail (p_id > 0, FALSE);
+	g_return_val_if_fail (o_id > 0, FALSE);
 
 	df = DATA_FORMAT_OBJECT_ID;
 	size = sizeof (guint32) * 4;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]