mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by
Use the __counted_by compiler attribute for the data[] flexible array member to improve the results of array bound sanitizers. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
9f4dc05107
commit
55a15b3a71
|
|
@ -104,7 +104,7 @@ struct garmin_packet {
|
|||
int seq;
|
||||
/* the real size of the data array, always > 0 */
|
||||
int size;
|
||||
__u8 data[];
|
||||
__u8 data[] __counted_by(size);
|
||||
};
|
||||
|
||||
/* structure used to keep the current state of the driver */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user