summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJeffrey Smith <whydoubt@gmail.com>2018-02-15 23:47:46 -0600
committerAdam Jackson <ajax@redhat.com>2018-02-19 13:12:18 -0500
commit272fa1817091117d078a22252a03d3161dfc7b0f (patch)
tree5ca75c97d9f317ffa7ba205fdaf603c36a183f01 /os
parent6f9d29040cd9f4723a2e6c1e5d2ec8104efc0710 (diff)
os: avoid uninitialized offsets in backtrace
When xorg_backtrace calls unw_get_proc_name and an error occurs, offset might not be set for the current frame. Initialize offset for each frame so that the offset from another frame cannot be used inadvertently. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'os')
-rw-r--r--os/backtrace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/os/backtrace.c b/os/backtrace.c
index 9e3e38edf..619bf145e 100644
--- a/os/backtrace.c
+++ b/os/backtrace.c
@@ -78,6 +78,7 @@ xorg_backtrace(void)
break;
}
+ off = 0;
ret = unw_get_proc_name(&cursor, procname, 256, &off);
if (ret && ret != -UNW_ENOMEM) {
if (ret != -UNW_EUNSPEC)