1
0
forked from fsfw/fsfw

added all coverity fixes

This commit is contained in:
2021-04-11 21:54:48 +02:00
parent b4594e6f43
commit b786b53c35
23 changed files with 95 additions and 57 deletions

View File

@ -51,7 +51,7 @@ void arrayprinter::printHex(const uint8_t *data, size_t size,
#else
// General format: 0x01, 0x02, 0x03 so it is number of chars times 6
// plus line break plus small safety margin.
char printBuffer[(size + 1) * 7 + 1];
char printBuffer[(size + 1) * 7 + 1] = {};
size_t currentPos = 0;
for(size_t i = 0; i < size; i++) {
// To avoid buffer overflows.
@ -94,7 +94,7 @@ void arrayprinter::printDec(const uint8_t *data, size_t size,
#else
// General format: 32, 243, -12 so it is number of chars times 5
// plus line break plus small safety margin.
char printBuffer[(size + 1) * 5 + 1];
char printBuffer[(size + 1) * 5 + 1] = {};
size_t currentPos = 0;
for(size_t i = 0; i < size; i++) {
// To avoid buffer overflows.