[gnome-system-log/gnome-3-8] log: make sure to always NULL-terminate log lines array
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-log/gnome-3-8] log: make sure to always NULL-terminate log lines array
- Date: Mon, 15 Apr 2013 21:54:48 +0000 (UTC)
commit b78a59ba6d291e56ce99df9c64bbb0e655a6432f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Apr 11 17:23:41 2013 -0400
log: make sure to always NULL-terminate log lines array
Even when we get an error, or we'll segfault when calling g_strfreev()
on it later.
https://bugzilla.gnome.org/show_bug.cgi?id=697790
src/logview-log.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/logview-log.c b/src/logview-log.c
index 292f160..57b9cd5 100644
--- a/src/logview-log.c
+++ b/src/logview-log.c
@@ -298,14 +298,14 @@ do_read_new_lines (GIOSchedulerJob *io_job,
g_ptr_array_add (lines, (gpointer) line);
}
+ /* NULL-terminate the array again */
+ g_ptr_array_add (lines, NULL);
+
if (err) {
job->err = err;
goto out;
}
- /* NULL-terminate the array again */
- g_ptr_array_add (lines, NULL);
-
log->priv->has_new_lines = FALSE;
/* we'll return only the new lines in the callback */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]