summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2005-10-29 18:49:05 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2005-10-29 18:49:05 +0000
commitdeff3312e51f6e1159f9b1e13189e8a1c9d809d6 (patch)
treedd0a2f8588029bbde5c231f7dfc757daf7c8cfe1
parent4e3416d41336731b788967ec9683f50edc52181c (diff)
Fix crash pointed reported by Rudi Chiarito.
Sat Oct 29 14:43:00 2005 Søren Sandmann <sandmann@redhat.com> Fix crash pointed reported by Rudi Chiarito. * stackstash.c (stack_stash_add_trace): Just return if n_addrs is 0. * sysprof.c (on_read): Only trace if n_addresses != 0.
-rw-r--r--ChangeLog9
-rw-r--r--stackstash.c3
-rw-r--r--sysprof.c4
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d640e5d..6486e1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sat Oct 29 14:43:00 2005 Søren Sandmann <sandmann@redhat.com>
+
+ Fix crash pointed reported by Rudi Chiarito.
+
+ * stackstash.c (stack_stash_add_trace): Just return if
+ n_addrs is 0.
+
+ * sysprof.c (on_read): Only trace if n_addresses != 0.
+
Mon Oct 10 14:33:50 2005 Søren Sandmann <sandmann@redhat.com>
* configure.ac: Add --disable-kernel-module option. Patch from
diff --git a/stackstash.c b/stackstash.c
index c7ecb1d..9f66f15 100644
--- a/stackstash.c
+++ b/stackstash.c
@@ -139,6 +139,9 @@ stack_stash_add_trace (StackStash *stash,
StackNode *leaf;
int i;
+ if (!n_addrs)
+ return;
+
trace = NULL;
for (i = 0; i < n_addrs; ++i)
trace = g_list_prepend (trace, GINT_TO_POINTER (addrs[i]));
diff --git a/sysprof.c b/sysprof.c
index 2b7284f..a667f66 100644
--- a/sysprof.c
+++ b/sysprof.c
@@ -370,7 +370,7 @@ on_read (gpointer data)
g_print ("-=-\n");
#endif
- if (rd > 0 && !app->generating_profile)
+ if (rd > 0 && !app->generating_profile && trace.n_addresses)
{
Process *process = process_get_from_pid (trace.pid);
int i;
@@ -378,7 +378,7 @@ on_read (gpointer data)
/* if (*trace.filename) */
/* filename = trace.filename; */
-
+
for (i = 0; i < trace.n_addresses; ++i)
{
process_ensure_map (process, trace.pid,