Task #971 - pcsc-lite-2.2.3-1.fc41/scan-results.err
back to task #971download
Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c: scope_hint: In function ‘configfile_create_buffer’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:1581:12: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/configfile.l:387:23: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:938:21: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:958:1: note: in expansion of macro ‘YY_DECL’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:982:18: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:982:18: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:1720:13: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:982:18: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:984:26: note: in expansion of macro ‘yy_create_buffer’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:1567:21: note: in expansion of macro ‘yy_create_buffer’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:1571:24: note: in expansion of macro ‘yyalloc’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c: scope_hint: In function ‘configfile_create_buffer’ # 1579| * we need to put in 2 end-of-buffer characters. # 1580| */ # 1581|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); # 1582| if ( ! b->yy_ch_buf ) # 1583| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); Error: CPPCHECK_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:1621: warning[nullPointer]: Possible null pointer dereference: b # 1619| # 1620| yy_flush_buffer( b ); # 1621|-> # 1622| b->yy_input_file = file; # 1623| b->yy_fill_buffer = 1; Error: CPPCHECK_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/configfile.c:1622: warning[nullPointer]: Possible null pointer dereference: b # 1620| yy_flush_buffer( b ); # 1621| # 1622|-> b->yy_input_file = file; # 1623| b->yy_fill_buffer = 1; # 1624| Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c: scope_hint: In function ‘tokenparser_create_buffer’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:1594:12: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:228:23: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:952:21: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:972:1: note: in expansion of macro ‘YY_DECL’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:996:18: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:996:18: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:1733:13: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:996:18: note: in expansion of macro ‘yyensure_buffer_stack’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:998:26: note: in expansion of macro ‘yy_create_buffer’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:1580:21: note: in expansion of macro ‘yy_create_buffer’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:1584:24: note: in expansion of macro ‘yyalloc’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c: scope_hint: In function ‘tokenparser_create_buffer’ # 1592| * we need to put in 2 end-of-buffer characters. # 1593| */ # 1594|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); # 1595| if ( ! b->yy_ch_buf ) # 1596| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); Error: CPPCHECK_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:1634: warning[nullPointer]: Possible null pointer dereference: b # 1632| # 1633| yy_flush_buffer( b ); # 1634|-> # 1635| b->yy_input_file = file; # 1636| b->yy_fill_buffer = 1; Error: CPPCHECK_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:1635: warning[nullPointer]: Possible null pointer dereference: b # 1633| yy_flush_buffer( b ); # 1634| # 1635|-> b->yy_input_file = file; # 1636| b->yy_fill_buffer = 1; # 1637| Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/atrhandler.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/debuglog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/eventhandler.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c: scope_hint: In function ‘HPReadBundleValues’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:235:44: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:169:25: note: in expansion of macro ‘GET_KEY’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:169:25: note: in expansion of macro ‘GET_KEY’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:177:25: note: in expansion of macro ‘GET_KEY’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:178:25: note: in expansion of macro ‘GET_KEY’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:178:25: note: in expansion of macro ‘GET_KEY’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:179:25: note: in expansion of macro ‘GET_KEY’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:179:25: note: in expansion of macro ‘GET_KEY’ # 233| driverSize * sizeof(*driverTracker)); # 234| # 235|-> if (NULL == tmp) # 236| { # 237| free(driverTracker); Error: GCC_ANALYZER_WARNING (CWE-688): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c: scope_hint: In function ‘HPAddDevice’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:467:36: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘tmpInterfaceName’ where non-null expected pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/hotplug_libudev.c:47: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 465| # 466| /* check the interface name contains only valid ASCII codes */ # 467|-> for (size_t i=0; i<strlen(tmpInterfaceName); i++) # 468| { # 469| if (! isascii(tmpInterfaceName[i])) Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/ifdwrapper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/ifdwrapper.c: scope_hint: In function ‘IFDOpenIFD’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/ifdwrapper.c:136:31: warning[-Wanalyzer-jump-through-null]: jump through null pointer # 134| /* use device name only if defined */ # 135| if (rContext->device[0] != '\0') # 136|-> rv = (*IFDH_create_channel_by_name) (rContext->slot, rContext->device); # 137| else # 138| rv = (*IFDH_create_channel) (rContext->slot, rContext->port); Error: CPPCHECK_WARNING: 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: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/pcscdaemon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/pcscdaemon.c: scope_hint: In function ‘main’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/pcscdaemon.c:564:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’ # 562| # 563| /* do not close stdin, stdout or stderr */ # 564|-> if (fd > 2) # 565| close(fd); # 566| } Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c: scope_hint: In function ‘RFAddReader’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:345:56: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(4)’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:57: included_from: Included from here. pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:1527:17: note: in expansion of macro ‘Log2’ # 343| RFUnloadReader unloads the driver library # 344| and there are still devices attached using it --mikeg*/ # 345|-> *(sReadersContexts[dwContext])->pFeeds = 1; # 346| } # 347| Error: GCC_ANALYZER_WARNING (CWE-688): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:352:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(40)’ where non-null expected pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:1527:17: note: in expansion of macro ‘Log2’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:51: included_from: Included from here. /usr/include/pthread.h:781:12: note: argument 1 of ‘pthread_mutex_init’ must be non-null # 350| sReadersContexts[dwContext]->mMutex = # 351| malloc(sizeof(pthread_mutex_t)); # 352|-> (void)pthread_mutex_init(sReadersContexts[dwContext]->mMutex, NULL); # 353| } # 354| Error: GCC_ANALYZER_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:358:56: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(4)’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:1527:17: note: in expansion of macro ‘Log2’ # 356| { # 357| sReadersContexts[dwContext]->pMutex = malloc(sizeof(int)); # 358|-> *(sReadersContexts[dwContext])->pMutex = 1; # 359| } # 360| Error: GCC_ANALYZER_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:449:17: warning[-Wanalyzer-overlapping-buffers]: overlapping buffers passed as arguments to ‘memcpy’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:1527:17: note: in expansion of macro ‘Log2’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:933:17: note: in expansion of macro ‘Log1’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:45: included_from: Included from here. /usr/include/string.h:43:14: note: the behavior of ‘memcpy’ is undefined for overlapping buffers # 447| /* Copy the previous reader name and increment the slot number */ # 448| tmpReader = sReadersContexts[dwContextB]->readerState->readerName; # 449|-> memcpy(tmpReader, # 450| sReadersContexts[dwContext]->readerState->readerName, # 451| sizeof(sReadersContexts[dwContextB]->readerState->readerName)); Error: GCC_ANALYZER_WARNING (CWE-688): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:525:31: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(40)’ where non-null expected pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:1527:17: note: in expansion of macro ‘Log2’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:933:17: note: in expansion of macro ‘Log1’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:517:25: note: in expansion of macro ‘Log1’ /usr/include/pthread.h:781:12: note: argument 1 of ‘pthread_mutex_init’ must be non-null # 523| sReadersContexts[dwContextB]->mMutex = # 524| malloc(sizeof(pthread_mutex_t)); # 525|-> (void)pthread_mutex_init(sReadersContexts[dwContextB]->mMutex, # 526| NULL); # 527| Error: GCC_ANALYZER_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:529:65: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(4)’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:1527:17: note: in expansion of macro ‘Log2’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:933:17: note: in expansion of macro ‘Log1’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:517:25: note: in expansion of macro ‘Log1’ # 527| # 528| sReadersContexts[dwContextB]->pMutex = malloc(sizeof(int)); # 529|-> *(sReadersContexts[dwContextB])->pMutex = 1; # 530| } # 531| else Error: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/readerfactory.c:710:14: warning[deadcode.DeadStores]: Value stored to 'extend' during its initialization is never read # 708| bool usedDigits[PCSCLITE_MAX_READERS_CONTEXTS]; # 709| int i; # 710|-> const char *extend = ""; # 711| # 712| /* Clear the list */ Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): 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: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:802:67: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from field 'mid') # 800| if ((err+1)/2 > 0) { /* correct pos RIGHT (err-1)/2 moves */ # 801| err = (err+1)/2; # 802|-> for (cnt = 0; cnt < (unsigned int)err; cnt++) dest->mid = dest->mid->next; # 803| } else if (err/2 < 0) { /* correct pos LEFT (err/2)-1 moves */ # 804| err = -err/2; Error: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/simclist.c:805:67: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from field 'mid') # 803| } else if (err/2 < 0) { /* correct pos LEFT (err/2)-1 moves */ # 804| err = -err/2; # 805|-> for (cnt = 0; cnt < (unsigned int)err; cnt++) dest->mid = dest->mid->prev; # 806| } # 807| Error: GCC_ANALYZER_WARNING (CWE-401): 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: 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): 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: 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: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/spy/libpcscspy.c:126:2: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 124| snprintf(threadid, sizeof threadid, "%lX@", pthread_self()); # 125| pthread_mutex_lock(&Log_fd_mutex); # 126|-> r = write(Log_fd, threadid, strlen(threadid)); # 127| r = write(Log_fd, line, strlen(line)); # 128| r = write(Log_fd, "\n", 1); Error: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/spy/libpcscspy.c:127:2: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 125| pthread_mutex_lock(&Log_fd_mutex); # 126| r = write(Log_fd, threadid, strlen(threadid)); # 127|-> r = write(Log_fd, line, strlen(line)); # 128| r = write(Log_fd, "\n", 1); # 129| (void)r; Error: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/spy/libpcscspy.c:155:2: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 153| snprintf(threadid, sizeof threadid, "%lX@", pthread_self()); # 154| pthread_mutex_lock(&Log_fd_mutex); # 155|-> r = write(Log_fd, threadid, strlen(threadid)); # 156| r = write(Log_fd, line, size); # 157| r = write(Log_fd, "\n", 1); Error: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/spy/libpcscspy.c:156:2: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 154| pthread_mutex_lock(&Log_fd_mutex); # 155| r = write(Log_fd, threadid, strlen(threadid)); # 156|-> r = write(Log_fd, line, size); # 157| r = write(Log_fd, "\n", 1); # 158| (void)r; Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/testpcsc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-786): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/testpcsc.c:232: error[negativeIndex]: Array 'iList[16]' accessed at index -1, which is out of bounds. # 230| iReader = 1; # 231| # 232|-> rgReaderStates[0].szReader = &mszReaders[iList[iReader]]; # 233| rgReaderStates[0].dwCurrentState = SCARD_STATE_EMPTY; # 234| Error: GCC_ANALYZER_WARNING (CWE-476): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l: scope_hint: In function ‘eval_key’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:98:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘elt’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:228:23: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:952:21: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:972:1: note: in expansion of macro ‘YY_DECL’ # 96| len++; /* final NULL byte */ # 97| # 98|-> elt->key = malloc(len); # 99| memcpy(elt->key, &pcToken[5], len-1); # 100| elt->key[len-1] = '\0'; Error: GCC_ANALYZER_WARNING (CWE-688): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:99:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(len)’ where non-null expected pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:228:23: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:952:21: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:972:1: note: in expansion of macro ‘YY_DECL’ <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 97| # 98| elt->key = malloc(len); # 99|-> memcpy(elt->key, &pcToken[5], len-1); # 100| elt->key[len-1] = '\0'; # 101| Error: GCC_ANALYZER_WARNING (CWE-688): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l: scope_hint: In function ‘eval_value’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:131:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘value’ where non-null expected pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:228:23: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:952:21: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:972:1: note: in expansion of macro ‘YY_DECL’ <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 129| assert(value); # 130| # 131|-> memcpy(value, &pcToken[8], len-1); # 132| value[len-1] = '\0'; # 133| Error: GCC_ANALYZER_WARNING (CWE-401): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:155:1: warning[-Wanalyzer-malloc-leak]: leak of ‘amp’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/tokenparser.l:228:23: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:952:21: note: in expansion of macro ‘yylex’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/redhat-linux-build/pcscd.p/tokenparser.c:972:1: note: in expansion of macro ‘YY_DECL’ # 153| assert(r >= 0); # 154| (void)r; # 155|-> } # 156| # 157| void tperrorCheck (char *token_error) Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_clnt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): 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(¤tContextMap->channelMapList, newChannelMap); # 3445|-> if (lrv < 0) # 3446| { # 3447| free(newChannelMap->readerName); Error: CLANG_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_clnt.c:3454:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'newChannelMap' # 3452| } # 3453| # 3454|-> return SCARD_S_SUCCESS; # 3455| } # 3456| Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_msg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_msg.c: scope_hint: In function ‘ClientSetupSession’ pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_msg.c:138:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor # 136| strncpy(svc_addr.sun_path, socketName, sizeof(svc_addr.sun_path)); # 137| # 138|-> if (connect(*pdwClientID, (struct sockaddr *) &svc_addr, # 139| sizeof(svc_addr.sun_family) + strlen(svc_addr.sun_path) + 1) < 0) # 140| { Error: CPPCHECK_WARNING: pcsc-lite-2.2.3-build/pcsc-lite-2.2.3/src/winscard_svc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.