Changing conditions to avoid Coverity to complain in artificial situations
CID 1090331 (#1 of 1): Out-of-bounds access (OVERRUN) 11. overrun-buffer-arg: Overrunning array "pnti->nai.abtUid" of 10 bytes by passing it to a function which accesses it at byte offset 11 using argument "pnti->nai.szUidLen" (which evaluates to 12).
This commit is contained in:
parent
a5e7dec797
commit
ddf58f2d69
1 changed files with 2 additions and 1 deletions
|
@ -503,7 +503,8 @@ pn53x_decode_target_data(const uint8_t *pbtRawData, size_t szRawData, pn53x_type
|
|||
if ((pnti->nai.szUidLen == 8) && (pbtUid[0] == 0x88)) {
|
||||
pnti->nai.szUidLen = 7;
|
||||
memcpy(pnti->nai.abtUid, pbtUid + 1, 7);
|
||||
} else if ((pnti->nai.szUidLen == 12) && (pbtUid[0] == 0x88) && (pbtUid[4] == 0x88)) {
|
||||
// } else if ((pnti->nai.szUidLen == 12) && (pbtUid[0] == 0x88) && (pbtUid[4] == 0x88)) {
|
||||
} else if (pnti->nai.szUidLen > 10) {
|
||||
pnti->nai.szUidLen = 10;
|
||||
memcpy(pnti->nai.abtUid, pbtUid + 1, 3);
|
||||
memcpy(pnti->nai.abtUid + 3, pbtUid + 5, 3);
|
||||
|
|
Loading…
Add table
Reference in a new issue