Skip to content

Commit a2b595a

Browse files
Shetty-Anushbuha
authored andcommitted
drivers:adc:ad7768-1: Add a check for data_size argument value in ad77681_compute_xor()
Signed-off-by: Anush Shetty <[email protected]>
1 parent 4aeb03d commit a2b595a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/adc/ad7768-1/ad77681.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ uint8_t ad77681_compute_xor(uint8_t *data,
8383
uint8_t buf[3];
8484
uint8_t i;
8585

86+
if (data_size > 3)
87+
return -EINVAL;
88+
8689
for (i = 0; i < data_size; i++) {
8790
buf[i] = *data;
8891
crc ^= buf[i];

0 commit comments

Comments
 (0)