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.
This commit is contained in:
Дмитрий Левин 2016-05-16 22:03:51 +00:00
parent 977aee82bf
commit 952d89ba5a

2
poll.c
View File

@ -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("}");