From e54f98a223d2a75df7d34c924a3baccd35530cb0 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 27 May 2016 00:41:43 +0000 Subject: [PATCH] evdev.c: fix decoding of struct input_id * evdev.c (getid_ioctl): Use umove_or_printaddr. --- evdev.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/evdev.c b/evdev.c index 1ffad841..f86416bb 100644 --- a/evdev.c +++ b/evdev.c @@ -232,19 +232,20 @@ keycode_V2_ioctl(struct tcb *tcp, long arg) static int getid_ioctl(struct tcb *tcp, long arg) { + tprints(", "); + struct input_id id; - if (!verbose(tcp) || umove(tcp, arg, &id) < 0) - return 0; + if (!umove_or_printaddr(tcp, arg, &id)) + tprintf("{ID_BUS=%" PRIu16 + ", ID_VENDOR=%" PRIu16 + ", ID_PRODUCT=%" PRIu16 + ", ID_VERSION=%" PRIu16 "}", + id.bustype, + id.vendor, + id.product, + id.version); - tprintf(", {ID_BUS=%" PRIu16 ", ID_VENDOR=%" PRIu16, - id.bustype, id.vendor); - if (!abbrev(tcp)) { - tprintf(", ID_PRODUCT=%" PRIu16 ", ID_VERSION=%" PRIu16 "}", - id.product, id.version); - } else { - tprints(", ...}"); - } return 1; } -- 2.50.1