Newly introduced defects

List of Defects

Error: CPPCHECK_WARNING: [#def1]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/libredirect.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c: scope_hint: In function ‘list_restore_filedescriptor’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:100:64: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1297:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1297:5: note: in expansion of macro ‘READ_ERRCHECK’
/usr/include/arpa/inet.h:22: included_from: Included from here.
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:39: included_from: Included from here.
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1305:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1305:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1307:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1311:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1316:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1320:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1324:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1328:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:98:74: note: in definition of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1342:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1297:5: note: in expansion of macro ‘READ_ERRCHECK’
#   98|                                                       if (read(fd, msgbuf, msglen) != msglen) {           \
#   99|                                                           /*errno = EPROTO;*/                             \
#  100|->                                                         return -1;                                      \
#  101|                                                       }                                                   \
#  102|                                                   } while (0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1349:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1297:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1305:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1305:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1307:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1311:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1316:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1320:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1324:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1328:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1352:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1352:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c: scope_hint: In function ‘list_restore_filedescriptor’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c: scope_hint: In function ‘list_restore_filedescriptor’
# 1347|               /* copy verbatim into memory */
# 1348|               for (cnt = 0; cnt < header.numels; cnt++) {
# 1349|->                 buf = malloc(header.elemlen);
# 1350|                   if (NULL == buf)
# 1351|                       return -1;

Error: CLANG_WARNING: [#def4]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1357:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf'
# 1355|               totmemorylen = header.numels * header.elemlen;
# 1356|           }
# 1357|->         totreadlen = header.numels * header.elemlen;
# 1358|       } else {
# 1359|           /* elements have variable size. Each element is preceded by its size */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1376:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1297:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1305:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1305:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1307:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1311:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1316:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1320:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1324:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1328:5: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1375:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1375:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1379:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1379:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c: scope_hint: In function ‘list_restore_filedescriptor’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c: scope_hint: In function ‘list_restore_filedescriptor’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1375:17: note: in expansion of macro ‘READ_ERRCHECK’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:1375:17: note: in expansion of macro ‘READ_ERRCHECK’
# 1374|               for (cnt = 0; cnt < header.numels; cnt++) {
# 1375|                   READ_ERRCHECK(fd, & elsize, sizeof(elsize));
# 1376|->                 buf = malloc(elsize);
# 1377|                   if (NULL == buf)
# 1378|                       return -1;

Error: CPPCHECK_WARNING: [#def6]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/spy/libpcscspy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_clnt.c: scope_hint: In function ‘SCardAddHandle’
pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_clnt.c:3445:12: warning[-Wanalyzer-malloc-leak]: leak of ‘newChannelMap’
# 3443|   
# 3444|   	lrv = list_append(&currentContextMap->channelMapList, newChannelMap);
# 3445|-> 	if (lrv < 0)
# 3446|   	{
# 3447|   		free(newChannelMap->readerName);

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-142.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namepcsc-lite-2.0.3-1.fc40
diffbase-store-results-to/tmp/tmp6oqaj_n4/pcsc-lite-2.0.3-1.fc40.tar.xz
diffbase-time-created2024-07-03 16:32:29
diffbase-time-finished2024-07-03 16:34:09
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp6oqaj_n4/pcsc-lite-2.0.3-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmp6oqaj_n4/pcsc-lite-2.0.3-1.fc40.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-142.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namepcsc-lite-2.2.3-1.fc41
store-results-to/tmp/tmpb4pvefem/pcsc-lite-2.2.3-1.fc41.tar.xz
time-created2024-07-03 16:34:33
time-finished2024-07-03 16:35:43
titleNewly introduced defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpb4pvefem/pcsc-lite-2.2.3-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpb4pvefem/pcsc-lite-2.2.3-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9