diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-02-21 02:30:58 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-02-21 02:30:58 +0800 |
commit | ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a (patch) | |
tree | 7ded0190ad1f547c3165330138a49fd9ea5f1442 /deskutils | |
parent | 1dca328e7b2f0545bbdbde4bc28456fe586223bd (diff) | |
download | marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.tar marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.tar.gz marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.tar.bz2 marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.tar.lz marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.tar.xz marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.tar.zst marcuscom-ports-ac4cb2bcac46bf84457e8485bbce5f3ba9e50d4a.zip |
Fix a potential crash and a definite memory leak in gnome-system-log. As
a nice side-effect, gnome-system-log seems to return accurate data now.
Crash reported by: mezz
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@3683 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'deskutils')
-rw-r--r-- | deskutils/gnome-utils/Makefile | 1 | ||||
-rw-r--r-- | deskutils/gnome-utils/files/patch-logview_logrtns.c | 21 | ||||
-rw-r--r-- | deskutils/gnomeutils2/Makefile | 1 | ||||
-rw-r--r-- | deskutils/gnomeutils2/files/patch-logview_logrtns.c | 21 |
4 files changed, 44 insertions, 0 deletions
diff --git a/deskutils/gnome-utils/Makefile b/deskutils/gnome-utils/Makefile index 54709bb73..69486c935 100644 --- a/deskutils/gnome-utils/Makefile +++ b/deskutils/gnome-utils/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomeutils2 PORTVERSION= 2.9.91 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= deskutils gnome MASTER_SITES= ${MASTER_SITE_GNOME} diff --git a/deskutils/gnome-utils/files/patch-logview_logrtns.c b/deskutils/gnome-utils/files/patch-logview_logrtns.c new file mode 100644 index 000000000..e435cd314 --- /dev/null +++ b/deskutils/gnome-utils/files/patch-logview_logrtns.c @@ -0,0 +1,21 @@ +--- logview/logrtns.c.orig Sun Feb 20 13:03:24 2005 ++++ logview/logrtns.c Sun Feb 20 13:27:46 2005 +@@ -217,6 +217,10 @@ OpenLogFile (char *filename) + return NULL; + } + ++ /* gnome_vfs_read_entire_file() does not return a NUL-terminated buffer. */ ++ buffer = g_realloc (buffer, size+1); ++ buffer[size] = '\0'; ++ + /* Alloc memory for log structure */ + tlog = g_new0 (Log, 1); + if (tlog == NULL) { +@@ -230,6 +234,7 @@ OpenLogFile (char *filename) + g_free (filename); + + buffer_lines = g_strsplit (buffer, "\n", -1); ++ g_free (buffer); + + /* count the lines */ + for (i=0; buffer_lines[i+1] != NULL; i++); diff --git a/deskutils/gnomeutils2/Makefile b/deskutils/gnomeutils2/Makefile index 54709bb73..69486c935 100644 --- a/deskutils/gnomeutils2/Makefile +++ b/deskutils/gnomeutils2/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomeutils2 PORTVERSION= 2.9.91 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= deskutils gnome MASTER_SITES= ${MASTER_SITE_GNOME} diff --git a/deskutils/gnomeutils2/files/patch-logview_logrtns.c b/deskutils/gnomeutils2/files/patch-logview_logrtns.c new file mode 100644 index 000000000..e435cd314 --- /dev/null +++ b/deskutils/gnomeutils2/files/patch-logview_logrtns.c @@ -0,0 +1,21 @@ +--- logview/logrtns.c.orig Sun Feb 20 13:03:24 2005 ++++ logview/logrtns.c Sun Feb 20 13:27:46 2005 +@@ -217,6 +217,10 @@ OpenLogFile (char *filename) + return NULL; + } + ++ /* gnome_vfs_read_entire_file() does not return a NUL-terminated buffer. */ ++ buffer = g_realloc (buffer, size+1); ++ buffer[size] = '\0'; ++ + /* Alloc memory for log structure */ + tlog = g_new0 (Log, 1); + if (tlog == NULL) { +@@ -230,6 +234,7 @@ OpenLogFile (char *filename) + g_free (filename); + + buffer_lines = g_strsplit (buffer, "\n", -1); ++ g_free (buffer); + + /* count the lines */ + for (i=0; buffer_lines[i+1] != NULL; i++); |