Add paranoia check before passing a long to pid2tcb(int pid)

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
diff --git a/strace.c b/strace.c
index f5ce18d..a489db4 100644
--- a/strace.c
+++ b/strace.c
@@ -2097,6 +2097,9 @@
 
 			if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, (long) &old_pid) < 0)
 				goto dont_switch_tcbs;
+			/* Avoid truncation in pid2tcb() param passing */
+			if (old_pid > UINT_MAX)
+				goto dont_switch_tcbs;
 			if (old_pid <= 0 || old_pid == pid)
 				goto dont_switch_tcbs;
 			execve_thread = pid2tcb(old_pid);