Skip to content

Commit

Permalink
Fix wrong buffer size
Browse files Browse the repository at this point in the history
Fix build issue:

```
/tmp/libfreefare/libfreefare/ntag21x.c:718:5: error: array index 1 is past the end of the array
      (which contains 1 element) [-Werror,-Warray-bounds]
    cmd_step1[1] = 0x00;
    ^         ~
/tmp/libfreefare/libfreefare/ntag21x.c:715:5: note: array 'cmd_step1' declared here
    uint8_t cmd_step1[1];
    ^
1 error generated.
```
  • Loading branch information
smortex committed Jan 26, 2019
1 parent 3d1e58b commit 5459806
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libfreefare/ntag21x.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ bool
ntag21x_is_auth_supported(nfc_device *device, nfc_iso14443a_info nai)
{
int ret;
uint8_t cmd_step1[1];
uint8_t cmd_step1[2];
uint8_t res_step1[8];
cmd_step1[0] = 0x60;
cmd_step1[1] = 0x00;
Expand Down

0 comments on commit 5459806

Please sign in to comment.