Newly introduced defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c: scope_hint: In function 'my_exec'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:331:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(*act.fd[i], i)'
#  329|       if (act->fd[i] != i)
#  330|         {
#  331|->         if (dup2 (act->fd[i], i) == -1)
#  332|             _gpgrt_log_fatal ("dup2 std%s failed: %s\n",
#  333|                               i==0?"in":i==1?"out":"err", strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:511:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'fd_in[0]'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:550:13: note: in expansion of macro 'xtrycalloc'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:604:15: note: in expansion of macro 'xfree'
#  509|     argv = xtrycalloc (i+2, sizeof *argv);
#  510|     if (!argv)
#  511|->     return _gpg_err_code_from_syserror ();
#  512|     if (pgmname)
#  513|       argv[0] = strrchr (pgmname, '/');

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c: scope_hint: In function '_gpgrt_process_spawn'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:511:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'fd_in[1]'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:58: included_from: Included from here.
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:550:13: note: in expansion of macro 'xtrycalloc'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:604:15: note: in expansion of macro 'xfree'
#  509|     argv = xtrycalloc (i+2, sizeof *argv);
#  510|     if (!argv)
#  511|->     return _gpg_err_code_from_syserror ();
#  512|     if (pgmname)
#  513|       argv[0] = strrchr (pgmname, '/');

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:511:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'fd_out[1]'
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:550:13: note: in expansion of macro 'xtrycalloc'
#  509|     argv = xtrycalloc (i+2, sizeof *argv);
#  510|     if (!argv)
#  511|->     return _gpg_err_code_from_syserror ();
#  512|     if (pgmname)
#  513|       argv[0] = strrchr (pgmname, '/');

Error: CLANG_WARNING: [#def5]
libgpg-error-1.50-build/libgpg-error-1.50/src/spawn-posix.c:695:22: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'r_process')
#  693|             xfree (process);
#  694|             xfree (argv);
#  695|->           *r_process = NULL;
#  696|             return 0;
#  697|           }

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.48-1.fc40
diffbase-store-results-to/tmp/tmptn_k6l4f/libgpg-error-1.48-1.fc40.tar.xz
diffbase-time-created2024-07-03 14:40:38
diffbase-time-finished2024-07-03 14:42:33
diffbase-toolcsmock
diffbase-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'
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.50-1.fc41
store-results-to/tmp/tmpkc9tahrl/libgpg-error-1.50-1.fc41.tar.xz
time-created2024-07-03 14:42:43
time-finished2024-07-03 14:44:14
titleNewly introduced defects
toolcsmock
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'
tool-versioncsmock-3.5.3-1.el9