[vinagre] fix a crash with empty history file
- From: Jonh Wendell <jwendell src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vinagre] fix a crash with empty history file
- Date: Wed, 27 Jan 2010 12:36:35 +0000 (UTC)
commit dcd085c19dd9101a6aad0ef6cd48f0259fb0f026
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jan 27 09:36:16 2010 -0300
fix a crash with empty history file
vinagre/vinagre-connect.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/vinagre/vinagre-connect.c b/vinagre/vinagre-connect.c
index e6115f2..a5599bd 100644
--- a/vinagre/vinagre-connect.c
+++ b/vinagre/vinagre-connect.c
@@ -203,7 +203,7 @@ saved_history (void)
{
history_from_file = g_strsplit (file_contents, "\n", 0);
len = g_strv_length (history_from_file);
- if (strlen (history_from_file[len-1]) == 0)
+ if (len > 0 && strlen (history_from_file[len-1]) == 0)
{
g_free (history_from_file[len-1]);
history_from_file[len-1] = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]