Hi,
between commits old commit: 49d3e07b59819c5f999369feb04543154a752817 new commit: a0d3c2c719cedcd68877ff911d4fb579bc39f0ed a new FP was introduced for:
void foo(const uint8_t* data, const uint32_t dataLength) { const uint32_t minimumLength = sizeof(uint16_t) + sizeof(uint16_t); if (dataLength >= minimumLength) { char* payload = new char[dataLength - minimumLength]; std::copy(&data[minimumLength], &data[dataLength], payload); } }
cppcheck reports:
error: Iterators of different containers 'data[minimumLength]' and 'data[dataLength]' are used together. [mismatchingContainers] std::copy(&data[minimumLength], &data[dataLength], payload); ^
Could you please check?
Thanks, Martin
I think this is the same problem: https://trac.cppcheck.net/ticket/10604
Log in to post a comment.
Hi,
between commits
old commit: 49d3e07b59819c5f999369feb04543154a752817
new commit: a0d3c2c719cedcd68877ff911d4fb579bc39f0ed
a new FP was introduced for:
cppcheck reports:
Could you please check?
Thanks,
Martin
I think this is the same problem: https://trac.cppcheck.net/ticket/10604