[tracker: 1/5] libtracker-common: Fix invalid read in tracker_string_to_date
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker: 1/5] libtracker-common: Fix invalid read in tracker_string_to_date
- Date: Thu, 1 Dec 2011 18:11:54 +0000 (UTC)
commit be663f393e6356411adfe6c99dfb12f55e47cb7b
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]