From b0695de14f4600d2026390fa36b66d7f0544f9fb Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 16 May 2016 22:05:06 +0000 Subject: [PATCH] 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. --- sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.40.0