cppcheck nullPointerOutOfMemory

This commit is contained in:
Philippe Teuwen committed 2025-03-24 23:46:43 +01:00
1 parent e42932738e
commit ad84875afd
44 files changed
+314 -5

No files matched your search

+4
View File
@@ -131,6 +131,10 @@ void printarr(const char *name, uint8_t *arr, int len) {
int cx, i;
size_t outsize = 40 + strlen(name) + len * 5;
char *output = calloc(outsize, sizeof(char));
if (output == NULL) {
PrintAndLogEx(ERR, "Memory allocation failed");
return;
}
cx = snprintf(output, outsize, "uint8_t %s[] = {", name);
for (i = 0; i < len; i++) {
if (cx < outsize)