summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristoph Egger <Christoph.Egger@amd.com>2009-07-17 17:48:03 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-17 17:48:03 +0000
commit18c9a9c3c2698d71575d49c308db88f295ddffed (patch)
tree6d846993652e881c25456d55b0cb32a9cb317f87
parent88e150a5695fc3f8cb9994b59f3b193003b56c9c (diff)
downloadfocaccia-qemu-18c9a9c3c2698d71575d49c308db88f295ddffed.tar.gz
focaccia-qemu-18c9a9c3c2698d71575d49c308db88f295ddffed.zip
bsd-users: fix strace
Hi!

Attached patch fixes an unlock bug in strace.
Catched by gcc due to an use of uninitialized variable.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
-rw-r--r--bsd-user/strace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index 0998dc5ba6..d73bbcabab 100644
--- a/bsd-user/strace.c
+++ b/bsd-user/strace.c
@@ -36,7 +36,7 @@ print_execve(const struct syscallname *name,
     unlock_user(s, arg1, 0);
 
     for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(abi_ulong)) {
-        abi_ulong *arg_ptr, arg_addr, s_addr;
+        abi_ulong *arg_ptr, arg_addr;
 
         arg_ptr = lock_user(VERIFY_READ, arg_ptr_addr, sizeof(abi_ulong), 1);
         if (!arg_ptr)
@@ -47,7 +47,7 @@ print_execve(const struct syscallname *name,
             break;
         if ((s = lock_user_string(arg_addr))) {
             gemu_log("\"%s\",", s);
-            unlock_user(s, s_addr, 0);
+            unlock_user(s, arg_addr, 0);
         }
     }