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, 3 Dec 2020 12:56:29 +0000 (12:56 +0000)
commitfea955083b7c81a649ddaf02f66aee491ab47a7f
tree99bc4ff9cd5b8b957ea18896700f534d067cbb89
parent78b884bd0b54f8fed5dbca626235d217ebc88269
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