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



commit e1a1f1e05f70bdeabb0db33202295990f01f0fc3
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 490f849..1cb8408 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -327,6 +327,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;
@@ -355,6 +358,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;
@@ -382,6 +388,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;
@@ -409,6 +418,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]