From: Dmitry V. Levin Date: Mon, 16 May 2016 22:05:06 +0000 (+0000) Subject: Fix printing of invalid struct ifreq.ifr_flags X-Git-Tag: v4.12~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0695de14f4600d2026390fa36b66d7f0544f9fb;p=strace Fix printing of invalid struct ifreq.ifr_flags * sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags to unsigned short to avoid potential sign-extension bug when printing invalid struct ifreq.ifr_flags. --- diff --git a/sock.c b/sock.c index 88a0df53..c9482946 100644 --- a/sock.c +++ b/sock.c @@ -97,7 +97,7 @@ print_ifreq(struct tcb *tcp, const unsigned int code, const long arg, case SIOCSIFFLAGS: case SIOCGIFFLAGS: tprints("ifr_flags="); - printflags(iffflags, ifr->ifr_flags, "IFF_???"); + printflags(iffflags, (unsigned short) ifr->ifr_flags, "IFF_???"); break; case SIOCSIFMETRIC: case SIOCGIFMETRIC: