Fixed defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
logrotate-3.21.0-build/logrotate-3.21.0/config.c: scope_hint: In function ‘readAddress’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:159:23: warning[-Wanalyzer-malloc-leak]: leak of ‘isolateValue(configFile,  lineNum,  key,  startPtr,  buf,  length)’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:14: included_from: Included from here.
logrotate-3.21.0-build/logrotate-3.21.0/config.c:3: included_from: Included from here.
logrotate-3.21.0-build/logrotate-3.21.0/config.c:16: included_from: Included from here.
logrotate-3.21.0-build/logrotate-3.21.0/config.c:520:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:530:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:530:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:530:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:531:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:531:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:531:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:532:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:532:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:532:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:533:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:533:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:533:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:534:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:534:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:534:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:535:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:535:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:535:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:536:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:536:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:536:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:537:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:537:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:537:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:538:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:538:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:538:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:539:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:539:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:539:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:560:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:560:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:560:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:1425:25: note: in expansion of macro ‘freeLogItem’
#  157|   static char *isolateLine(char **strt, char **buf, size_t length) {
#  158|       char *endtag, *start, *tmp;
#  159|->     const char *max = *buf + length;
#  160|       char *key;
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def2]
logrotate-3.21.0-build/logrotate-3.21.0/config.c: scope_hint: In function ‘free_2d_array’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:500:5: warning[-Wanalyzer-double-free]: double-‘free’ of ‘array’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:520:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:530:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:530:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:530:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:531:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:531:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:531:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:532:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:532:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:532:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:533:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:533:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:533:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:534:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:534:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:534:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:535:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:535:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:535:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:536:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:536:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:536:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:537:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:537:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:537:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:538:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:538:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:538:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:505:14: note: in definition of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:539:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:539:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:539:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:560:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:560:5: note: in expansion of macro ‘MEMBER_COPY’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:560:5: note: in expansion of macro ‘MEMBER_COPY’
#  498|       for (i = 0; i < lines_count; ++i)
#  499|           free(array[i]);
#  500|->     free(array);
#  501|   }
#  502|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
logrotate-3.21.0-build/logrotate-3.21.0/config.c: scope_hint: In function ‘readConfigPath’
logrotate-3.21.0-build/logrotate-3.21.0/config.c:684:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".", 0)’
#  682|           }
#  683|           while ((dp = readdir(dirp)) != NULL) {
#  684|->             if (checkFile(dp->d_name)) {
#  685|                   /* Realloc memory for namelist array if necessary */
#  686|                   if (files_count % REALLOC_STEP == 0) {

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-10.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namelogrotate-3.22.0-1.fc41
diffbase-store-results-to/tmp/tmpsjgmj0u7/logrotate-3.22.0-1.fc41.tar.xz
diffbase-time-created2024-07-03 16:15:00
diffbase-time-finished2024-07-03 16:16:13
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpsjgmj0u7/logrotate-3.22.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpsjgmj0u7/logrotate-3.22.0-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-10.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelogrotate-3.21.0-6.fc40
store-results-to/tmp/tmppuicp24n/logrotate-3.21.0-6.fc40.tar.xz
time-created2024-07-03 16:12:57
time-finished2024-07-03 16:14:35
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmppuicp24n/logrotate-3.21.0-6.fc40.tar.xz' '--gcc-analyze' '/tmp/tmppuicp24n/logrotate-3.21.0-6.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9