aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-01-16 00:01:35 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-01-16 00:01:35 +0800
commitff3935d0a6e4b639a070f3f980187d4774ca5da8 (patch)
tree1fe8895f7752604646b2af35f3642b1842e2407e /calendar
parent12d6acd7bcec525403136599c16808d9cbe896e4 (diff)
downloadgsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.gz
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.bz2
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.lz
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.xz
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.zst
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.zip
'2001-01-15 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (print_local): prevent segfaults and buffer overflows (print_remote): ditto 2001-01-15 JP Rosevear <jpr@ximian.com> * conduits/todo/todo-conduit.c (print_local): prevent segfaults and buffer overflows. (print_remote): ditto * conduits/calendar/calendar-conduit.c: as above svn path=/trunk/; revision=7504
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c24
-rw-r--r--calendar/conduits/todo/todo-conduit.c38
3 files changed, 46 insertions, 24 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 5238ab7e7f..e38ba3f411 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2001-01-15 JP Rosevear <jpr@ximian.com>
+
+ * conduits/todo/todo-conduit.c (print_local): prevent segfaults and
+ buffer overflows.
+ (print_remote): ditto
+
+ * conduits/calendar/calendar-conduit.c: as above
+
2001-01-14 Damon Chaplin <damon@helixcode.com>
* gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): changed the expansion
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 27163b9eeb..1ffe47b890 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -77,11 +77,13 @@ print_local (ECalLocalRecord *local)
}
if (local->appt && local->appt->description) {
- sprintf (buff, "[%ld %ld '%s' '%s']",
- mktime (&local->appt->begin),
- mktime (&local->appt->end),
- local->appt->description,
- local->appt->note);
+ g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']",
+ mktime (&local->appt->begin),
+ mktime (&local->appt->end),
+ local->appt->description ?
+ local->appt->description : "",
+ local->appt->note ?
+ local->appt->note : "");
return buff;
}
@@ -101,11 +103,13 @@ static char *print_remote (GnomePilotRecord *remote)
memset (&appt, 0, sizeof (struct Appointment));
unpack_Appointment (&appt, remote->record, remote->length);
- sprintf (buff, "[%ld %ld '%s' '%s']",
- mktime (&appt.begin),
- mktime (&appt.end),
- appt.description,
- appt.note);
+ g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']",
+ mktime (&appt.begin),
+ mktime (&appt.end),
+ appt.description ?
+ appt.description : "",
+ appt.note ?
+ appt.note : "");
return buff;
}
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index d232b88173..abc3bd498d 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -77,13 +77,18 @@ print_local (EToDoLocalRecord *local)
}
if (local->todo && local->todo->description) {
- sprintf (buff, "[%d %ld %d %d '%s' '%s']",
- local->todo->indefinite,
- mktime (& local->todo->due),
- local->todo->priority,
- local->todo->complete,
- local->todo->description,
- local->todo->note);
+ g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']",
+ local->todo->indefinite ?
+ local->todo->indefinite : "",
+ mktime (& local->todo->due),
+ local->todo->priority ?
+ local->todo->priority : "",
+ local->todo->complete ?
+ local->todo->complete : "",
+ local->todo->description ?
+ local->todo->description : "",
+ local->todo->note ?
+ local->todo->note : "");
return buff;
}
@@ -103,13 +108,18 @@ static char *print_remote (GnomePilotRecord *remote)
memset (&todo, 0, sizeof (struct ToDo));
unpack_ToDo (&todo, remote->record, remote->length);
- sprintf (buff, "[%d %ld %d %d '%s' '%s']",
- todo.indefinite,
- mktime (& todo.due),
- todo.priority,
- todo.complete,
- todo.description,
- todo.note);
+ g_snprintf (buff, "[%d %ld %d %d '%s' '%s']",
+ todo.indefinite ?
+ todo.indefinite : "",
+ mktime (&todo.due),
+ todo.priority ?
+ todo.priority : "",
+ todo.complete ?
+ todo.complete : "",
+ todo.description ?
+ todo.description : "",
+ todo.note ?
+ todo.note : "");
return buff;
}