file-5.45-5.fc41
List of Defects
Error: COMPILER_WARNING (CWE-457): [#def1]
file-5.45/src/readelf.c:141:33: warning[-Wmaybe-uninitialized]: 'cap32.c_un.c_val' may be used uninitialized
# 141 | #define elf_getu32(swap, value) getu32(swap, value)
# | ^~~~~~~~~~~~~~~~~~~
file-5.45/src/readelf.c:1502:43: note: 'cap32' declared here
# 1502 | Elf32_Cap cap32;
# | ^~~~~
# 139|
# 140| #define elf_getu16(swap, value) getu16(swap, value)
# 141|-> #define elf_getu32(swap, value) getu32(swap, value)
# 142| #define elf_getu64(swap, value) getu64(swap, value)
# 143|
Error: COMPILER_WARNING (CWE-457): [#def2]
file-5.45/src/readelf.c: scope_hint: In function 'doshn'
file-5.45/src/readelf.c:142:33: warning[-Wmaybe-uninitialized]: 'cap64.c_un.c_val' may be used uninitialized
# 142 | #define elf_getu64(swap, value) getu64(swap, value)
# | ^~~~~~~~~~~~~~~~~~~
file-5.45/src/readelf.c:1503:43: note: 'cap64' declared here
# 1503 | Elf64_Cap cap64;
# | ^~~~~
# 140| #define elf_getu16(swap, value) getu16(swap, value)
# 141| #define elf_getu32(swap, value) getu32(swap, value)
# 142|-> #define elf_getu64(swap, value) getu64(swap, value)
# 143|
# 144| #define xsh_addr (clazz == ELFCLASS32 \
Error: CPPCHECK_WARNING (CWE-758): [#def3]
file-5.45/src/softmagic.c:1220: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1218| }
# 1219| case FILE_BESHORT:
# 1220|-> p->h = CAST(short, BE16(p));
# 1221| if (cvt_16(p, m) == -1)
# 1222| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def4]
file-5.45/src/softmagic.c:1227: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1225| case FILE_BEDATE:
# 1226| case FILE_BELDATE:
# 1227|-> p->l = CAST(int32_t, BE32(p));
# 1228| if (cvt_32(p, m) == -1)
# 1229| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def5]
file-5.45/src/softmagic.c:1235: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1233| case FILE_BEQLDATE:
# 1234| case FILE_BEQWDATE:
# 1235|-> p->q = CAST(uint64_t, BE64(p));
# 1236| if (cvt_64(p, m) == -1)
# 1237| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def6]
file-5.45/src/softmagic.c:1240: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1238| return 1;
# 1239| case FILE_LESHORT:
# 1240|-> p->h = CAST(short, LE16(p));
# 1241| if (cvt_16(p, m) == -1)
# 1242| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def7]
file-5.45/src/softmagic.c:1247: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1245| case FILE_LEDATE:
# 1246| case FILE_LELDATE:
# 1247|-> p->l = CAST(int32_t, LE32(p));
# 1248| if (cvt_32(p, m) == -1)
# 1249| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def8]
file-5.45/src/softmagic.c:1255: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1253| case FILE_LEQLDATE:
# 1254| case FILE_LEQWDATE:
# 1255|-> p->q = CAST(uint64_t, LE64(p));
# 1256| if (cvt_64(p, m) == -1)
# 1257| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def9]
file-5.45/src/softmagic.c:1262: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1260| case FILE_MEDATE:
# 1261| case FILE_MELDATE:
# 1262|-> p->l = CAST(int32_t, ME32(p));
# 1263| if (cvt_32(p, m) == -1)
# 1264| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def10]
file-5.45/src/softmagic.c:1271: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1269| return 1;
# 1270| case FILE_BEFLOAT:
# 1271|-> p->l = BE32(p);
# 1272| if (cvt_float(p, m) == -1)
# 1273| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def11]
file-5.45/src/softmagic.c:1276: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1274| return 1;
# 1275| case FILE_LEFLOAT:
# 1276|-> p->l = LE32(p);
# 1277| if (cvt_float(p, m) == -1)
# 1278| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def12]
file-5.45/src/softmagic.c:1285: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1283| return 1;
# 1284| case FILE_BEDOUBLE:
# 1285|-> p->q = BE64(p);
# 1286| if (cvt_double(p, m) == -1)
# 1287| goto out;
Error: CPPCHECK_WARNING (CWE-758): [#def13]
file-5.45/src/softmagic.c:1290: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 1288| return 1;
# 1289| case FILE_LEDOUBLE:
# 1290|-> p->q = LE64(p);
# 1291| if (cvt_double(p, m) == -1)
# 1292| goto out;
Scan Properties
analyzer-version-clang | 18.1.3 |
analyzer-version-cppcheck | 2.13.0 |
analyzer-version-gcc | 14.0.1 |
analyzer-version-gcc-analyzer | 14.0.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-116.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | file-5.45-5.fc41 |
store-results-to | /tmp/tmp0_rsoy78/file-5.45-5.fc41.tar.xz |
time-created | 2024-04-22 10:47:31 |
time-finished | 2024-04-22 10:49:08 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp0_rsoy78/file-5.45-5.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp0_rsoy78/file-5.45-5.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |