[tracker/tracker-0.10] libtracker-common: Fix invalid read in tracker_string_to_date



commit b27902da0d7463ecdca6780684b2fd330b3024aa
Author: JÃrg Billeter <j bitron ch>
Date:   Thu Dec 1 18:53:54 2011 +0100

    libtracker-common: Fix invalid read in tracker_string_to_date

 src/libtracker-common/tracker-date-time.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-common/tracker-date-time.c b/src/libtracker-common/tracker-date-time.c
index 56eeed5..8e42bd2 100644
--- a/src/libtracker-common/tracker-date-time.c
+++ b/src/libtracker-common/tracker-date-time.c
@@ -112,7 +112,7 @@ tracker_string_to_date (const gchar *date_string,
 	g_free (match);
 
 	match = g_match_info_fetch (match_info, 8);
-	if (match) {
+	if (match && strlen (match) > 0) {
 		/* timezoned */
 		g_free (match);
 
@@ -129,7 +129,7 @@ tracker_string_to_date (const gchar *date_string,
 		offset = 0;
 
 		match = g_match_info_fetch (match_info, 9);
-		if (match) {
+		if (match && strlen (match) > 0) {
 			/* non-UTC timezone */
 
 			gboolean positive_offset;
@@ -177,7 +177,7 @@ tracker_string_to_date (const gchar *date_string,
 	}
 
 	match = g_match_info_fetch (match_info, 7);
-	if (match) {
+	if (match && strlen (match) > 0) {
 		char milliseconds[4] = "000\0";
 		/* first character of match is decimal point
 		   we're interested in a maximum of 3 decimal places (milliseconds) */



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