From: Dmitry V. Levin Date: Mon, 16 May 2016 22:03:51 +0000 (+0000) Subject: Fix printing of invalid struct pollfd.events X-Git-Tag: v4.12~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=952d89ba5a1f7131d5b722bd1dd0b69955ca6515;p=strace Fix printing of invalid struct pollfd.events * poll.c (print_pollfd): Explicitly cast struct pollfd.events to unsigned short to avoid potential sign-extension bug when printing invalid struct pollfd.events. --- diff --git a/poll.c b/poll.c index f116cef0..b66c46d8 100644 --- a/poll.c +++ b/poll.c @@ -40,7 +40,7 @@ print_pollfd(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) printfd(tcp, fds->fd); if (fds->fd >= 0) { tprints(", events="); - printflags(pollflags, fds->events, "POLL???"); + printflags(pollflags, (unsigned short) fds->events, "POLL???"); } tprints("}");