tools/kdd: mute spurious gcc warning
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Thu, 5 Apr 2018 01:50:55 +0000 (03:50 +0200)
committerHans van Kranenburg <hans@knorrie.org>
Thu, 1 Oct 2020 12:50:58 +0000 (13:50 +0100)
commit7097c57f24b9222f3f4cde12e7bdbd4e822bcaba
tree814ef450b26d96dedc71912b676d6b5cefb23d49
parentf43767ce2834f4a1d36b006fef18355752e7cdfe
tools/kdd: mute spurious gcc warning

gcc-8 complains:

    kdd.c:698:13: error: 'memcpy' offset [-204, -717] is out of the bounds [0, 216] of object 'ctrl' with type 'kdd_ctrl' {aka 'union <anonymous>'} [-Werror=array-bounds]
                 memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    kdd.c: In function 'kdd_select_callback':
    kdd.c:642:14: note: 'ctrl' declared here
         kdd_ctrl ctrl;
                  ^~~~

But this is impossible - 'offset' is unsigned and correctly validated
few lines before.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-Acked-by: Juergen Gross <jgross@suse.com>
(cherry picked from commit 437e00fea04becc91c1b6bc1c0baa636b067a5cc)

Gbp-Pq: Name 0026-tools-kdd-mute-spurious-gcc-warning.patch
tools/debugger/kdd/kdd.c