Fixed defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1]
libgpg-error-1.48-build/libgpg-error-1.48/src/argparse.c:39: included_from: Included from here.
libgpg-error-1.48-build/libgpg-error-1.48/src/argparse.c: scope_hint: In function '_gpgrt_argparse.part.0'
libgpg-error-1.48-build/libgpg-error-1.48/src/argparse.c:1772:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'keyword[0]'
libgpg-error-1.48-build/libgpg-error-1.48/src/gpgrt-int.h:579:5: note: in definition of macro 'gpgrt_assert'
libgpg-error-1.48-build/libgpg-error-1.48/src/gpgrt-int.h:579:5: note: in definition of macro 'gpgrt_assert'
libgpg-error-1.48-build/libgpg-error-1.48/src/gpgrt-int.h:579:5: note: in definition of macro 'gpgrt_assert'
# 1770|           {
# 1771|             /* We are at the end of a line.  */
# 1772|->           gpgrt_assert (*keyword == '[');
# 1773|             trim_spaces (keyword+1);
# 1774|             if (!keyword[1])

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libgpg-error-1.48-build/libgpg-error-1.48/src/spawn-posix.c: scope_hint: In function 'do_exec'
libgpg-error-1.48-build/libgpg-error-1.48/src/spawn-posix.c:316:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(fds[i], i)'
#  314|         if (nodevnull[i])
#  315|           continue;
#  316|->       if (fds[i] != i && dup2 (fds[i], i) == -1)
#  317|           _gpgrt_log_fatal ("dup2 std%s failed: %s\n",
#  318|                             i==0?"in":i==1?"out":"err", strerror (errno));

Error: GCC_ANALYZER_WARNING: [#def3]
libgpg-error-1.48-build/libgpg-error-1.48/src/spawn-posix.c:316:26: warning[-Wanalyzer-fd-use-without-check]: 'dup2' on possibly invalid file descriptor '-1'
#  314|         if (nodevnull[i])
#  315|           continue;
#  316|->       if (fds[i] != i && dup2 (fds[i], i) == -1)
#  317|           _gpgrt_log_fatal ("dup2 std%s failed: %s\n",
#  318|                             i==0?"in":i==1?"out":"err", strerror (errno));

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-231.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namelibgpg-error-1.50-1.fc41
diffbase-store-results-to/tmp/tmpkc9tahrl/libgpg-error-1.50-1.fc41.tar.xz
diffbase-time-created2024-07-03 14:42:43
diffbase-time-finished2024-07-03 14:44:14
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpkc9tahrl/libgpg-error-1.50-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpkc9tahrl/libgpg-error-1.50-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-231.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibgpg-error-1.48-1.fc40
store-results-to/tmp/tmptn_k6l4f/libgpg-error-1.48-1.fc40.tar.xz
time-created2024-07-03 14:40:38
time-finished2024-07-03 14:42:33
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmptn_k6l4f/libgpg-error-1.48-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmptn_k6l4f/libgpg-error-1.48-1.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9