]> granicus.if.org Git - strace/commit
evdev: avoid bit vector decoding on non-successful and 0 return codes
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 12 Jul 2019 12:38:33 +0000 (14:38 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 13 Jul 2019 11:48:01 +0000 (11:48 +0000)
commit7ada13f3a40e2f58aea335cf910666378e7dd99a
tree16973a4b1c2733b0136b49fbb97f5460ad81c5a9
parent1e2137be9553255ea79eb6f9d6828745913688e4
evdev: avoid bit vector decoding on non-successful and 0 return codes

Reported by Clang.

    strace/evdev.c:157:3: note: The value 0 is assigned to 'size'
    #                size = tcp->u_rval * 8;
    #                ^~~~~~~~~~~~~~~~~~~~~~
    strace/evdev.c:158:2: warning: Declared variable-length array (VLA)
    has zero size
    #        char decoded_arg[size];
    #        ^

* evdev.c (decode_bitset_): Bail out before decoded_arg VLA definition.
evdev.c