diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-10-22 23:39:31 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-10-22 23:39:31 +0300 |
commit | 61401f24ef91b8b4321fd250c5942e9ec6ed3076 (patch) | |
tree | 9eedfb743a530bda291928901a3a3ffed195c616 /winsup/utils/strace.cc | |
parent | 46c472a1c15a61af1db656f6b55af9b4e5e450d6 (diff) |
strace: Add comment trying to explain confusing code
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/utils/strace.cc')
-rw-r--r-- | winsup/utils/strace.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index 5d4a23d0f..eb96a61b6 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -472,6 +472,12 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile) len = 17; } + /* Note that the following code deliberately points buf 20 bytes into the + allocated area. The subsequent code then overwrites the usecs value + given in the application's debug string, which potentially prepends + characters to the string. If that sounds confusing and dangerous, well... + + TODO: This needs a cleanup. */ char *buf; buf = (char *) alloca (len + 85) + 20; |