Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls

* fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence
fields to unsigned short to avoid potential sign-extension bug when
printing invalid l_type or l_whence fields.
This commit is contained in:
Дмитрий Левин 2016-05-16 21:57:08 +00:00
parent 6e381c67fd
commit a734a97d0e

View File

@ -43,9 +43,9 @@ static void
print_struct_flock64(const struct_kernel_flock64 *fl, const int getlk)
{
tprints("{l_type=");
printxval(lockfcmds, fl->l_type, "F_???");
printxval(lockfcmds, (unsigned short) fl->l_type, "F_???");
tprints(", l_whence=");
printxval(whence_codes, fl->l_whence, "SEEK_???");
printxval(whence_codes, (unsigned short) fl->l_whence, "SEEK_???");
tprintf(", l_start=%lld, l_len=%lld",
(long long) fl->l_start, (long long) fl->l_len);
if (getlk)