tracker r2807 - in trunk: . src/libtracker-common src/tracker-extract
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2807 - in trunk: . src/libtracker-common src/tracker-extract
- Date: Tue, 20 Jan 2009 11:07:55 +0000 (UTC)
Author: carlosg
Date: Tue Jan 20 11:07:55 2009
New Revision: 2807
URL: http://svn.gnome.org/viewvc/tracker?rev=2807&view=rev
Log:
2009-01-20 Carlos Garnacho <carlos imendio com>
* src/tracker-extract/tracker-escape.c (tracker_escape_metadata):
* src/libtracker-common/tracker-utils.c (tracker_escape_string):
Accept NULL strings. (Fixes NB98170)
* src/libtracker-common/tracker-type-utils.c
(tracker_date_format_to_iso8601): Do not memset a stack allocated
variable.
Modified:
trunk/ChangeLog
trunk/src/libtracker-common/tracker-type-utils.c
trunk/src/libtracker-common/tracker-utils.c
trunk/src/tracker-extract/tracker-escape.c
Modified: trunk/src/libtracker-common/tracker-type-utils.c
==============================================================================
--- trunk/src/libtracker-common/tracker-type-utils.c (original)
+++ trunk/src/libtracker-common/tracker-type-utils.c Tue Jan 20 11:07:55 2009
@@ -312,13 +312,11 @@
const gchar *format)
{
gchar *result;
- struct tm date_tm;
+ struct tm date_tm = { 0 };
g_return_val_if_fail (date_string != NULL, NULL);
g_return_val_if_fail (format != NULL, NULL);
- memset (&date_tm, 0, sizeof (struct tm));
-
if (strptime (date_string, format, &date_tm) == 0) {
return NULL;
}
Modified: trunk/src/libtracker-common/tracker-utils.c
==============================================================================
--- trunk/src/libtracker-common/tracker-utils.c (original)
+++ trunk/src/libtracker-common/tracker-utils.c Tue Jan 20 11:07:55 2009
@@ -106,6 +106,10 @@
{
gchar **array, *out;
+ if (!in) {
+ return NULL;
+ }
+
if (!strchr (in, '\'')) {
return g_strdup (in);
}
Modified: trunk/src/tracker-extract/tracker-escape.c
==============================================================================
--- trunk/src/tracker-extract/tracker-escape.c (original)
+++ trunk/src/tracker-extract/tracker-escape.c Tue Jan 20 11:07:55 2009
@@ -31,6 +31,10 @@
{
gchar *dest, *d;
+ if (!str) {
+ return NULL;
+ }
+
d = dest = g_malloc (strlen (str) * 4 + 1);
while (*str) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]