From: Dmitry V. Levin Date: Mon, 16 May 2016 22:25:46 +0000 (+0000) Subject: Fix printing of invalid struct ubi_mkvol_req.vol_type X-Git-Tag: v4.12~142 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2cad72f489560533d4f0cbcd30cbc0bdf8c59409;p=strace Fix printing of invalid struct ubi_mkvol_req.vol_type * mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type to unsigned short to avoid potential sign-extension bug when printing invalid struct ubi_mkvol_req.vol_type. --- diff --git a/mtd.c b/mtd.c index 25025367..208858d3 100644 --- a/mtd.c +++ b/mtd.c @@ -353,7 +353,8 @@ ubi_ioctl(struct tcb *tcp, const unsigned int code, const long arg) tprintf("{vol_id=%" PRIi32 ", alignment=%" PRIi32 ", bytes=%" PRIi64 ", vol_type=", mkvol.vol_id, mkvol.alignment, (int64_t)mkvol.bytes); - printxval(ubi_volume_types, mkvol.vol_type, "UBI_???_VOLUME"); + printxval(ubi_volume_types, + (uint8_t) mkvol.vol_type, "UBI_???_VOLUME"); tprintf(", name_len=%" PRIi16 ", name=", mkvol.name_len); if (print_quoted_string(mkvol.name, CLAMP(mkvol.name_len, 0, UBI_MAX_VOLUME_NAME),