libblockdev-3.4.0-99.20260113083332766364.master.49.gfabc60c9

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c: scope_hint: In function ‘write_all.part.0’
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:68:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:68:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:68:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:68:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c: scope_hint: In function ‘read_line’
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:81:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:81:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:81:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:81:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:93:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:93:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:93:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:93:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:99:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:99:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:99:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:99:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:102:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:102:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:102:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(input_filename, "rb")’

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libblockdev-3.4.0/src/lib/tmp-introspectw2y3dvym/BlockDev-3.0.c:102:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(output_filename, "wb")’

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
libblockdev-3.4.0/src/plugins/crypto.c: scope_hint: In function 'bd_crypto_error_quark'
libblockdev-3.4.0/src/plugins/crypto.c:474:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 0)'
#  472|   GQuark bd_crypto_error_quark (void)
#  473|   {
#  474|->     return g_quark_from_static_string ("g-bd-crypto-error-quark");
#  475|   }
#  476|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
libblockdev-3.4.0/src/plugins/crypto.c: scope_hint: In function 'bd_crypto_device_is_luks'
libblockdev-3.4.0/src/plugins/crypto.c:542:38: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 524288)'
#  540|       /* we may need to try multiple times with some delays in case the device is
#  541|          busy at the very moment */
#  542|->     for (n_try=5, status=-1; (status != 0) && (n_try > 0); n_try--) {
#  543|           status = blkid_probe_set_device (probe, fd, 0, 0);
#  544|           if (status != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
libblockdev-3.4.0/src/plugins/crypto.c: scope_hint: In function 'get_subsystem_label'
libblockdev-3.4.0/src/plugins/crypto.c:2483:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 524288)'
# 2481|       }
# 2482|   
# 2483|->     status = blkid_probe_set_device (probe, fd, 0, 0);
# 2484|       if (status != 0) {
# 2485|           g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def24]
libblockdev-3.4.0/src/plugins/crypto.c: scope_hint: In function 'bd_crypto_device_seems_encrypted'
libblockdev-3.4.0/src/plugins/crypto.c:3175:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 0)'
# 3173|   
# 3174|       if (read (fd, buf, sizeof (buf)) != sizeof (buf)) {
# 3175|->         g_set_error (&l_error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_DEVICE, "Failed to read device");
# 3176|           bd_utils_report_finished (progress_id, l_error->message);
# 3177|           g_propagate_error (error, l_error);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
libblockdev-3.4.0/src/plugins/crypto.c:3176:55: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 0)'
# 3174|       if (read (fd, buf, sizeof (buf)) != sizeof (buf)) {
# 3175|           g_set_error (&l_error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_DEVICE, "Failed to read device");
# 3176|->         bd_utils_report_finished (progress_id, l_error->message);
# 3177|           g_propagate_error (error, l_error);
# 3178|           close (fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
libblockdev-3.4.0/src/plugins/crypto.c:3182:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 0)'
# 3180|       }
# 3181|   
# 3182|->     close (fd);
# 3183|   
# 3184|       /* Calculate Chi Square */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
libblockdev-3.4.0/src/plugins/crypto.c: scope_hint: In function 'bd_crypto_escrow_device'
libblockdev-3.4.0/src/plugins/crypto.c:3511:56: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libblockdev-3.4.0/src/plugins/crypto.c:21: included_from: Included from here.
libblockdev-3.4.0/src/plugins/crypto.c:3510:22: note: in expansion of macro 'g_strdup'
libblockdev-3.4.0/src/plugins/crypto.c: scope_hint: In function 'bd_crypto_escrow_device'
libblockdev-3.4.0/src/plugins/crypto.c:20: included_from: Included from here.
/usr/include/string.h:439:15: note: argument 1 of 'strlen' must be non-null
# 3509|   
# 3510|       cert_data_copy = g_strdup (cert_data);
# 3511|->     cert = CERT_DecodeCertFromPackage (cert_data_copy, strlen (cert_data_copy));
# 3512|       if (!cert) {
# 3513|           g_set_error (&l_error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_CERT_DECODE,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def28]
libblockdev-3.4.0/src/plugins/dm_logging.c: scope_hint: In function 'redirect_dm_log'
libblockdev-3.4.0/src/plugins/dm_logging.c:37:11: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
#   35|   
#   36|       va_start (args, f);
#   37|->     ret = g_vasprintf (&dm_msg, f, args);
#   38|       va_end (args);
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
libblockdev-3.4.0/src/plugins/fs/common.c: scope_hint: In function 'get_uuid_label'
libblockdev-3.4.0/src/plugins/fs/common.c:68:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 524288)'
#   66|       }
#   67|   
#   68|->     status = blkid_probe_set_device (probe, fd, 0, 0);
#   69|       if (status != 0) {
#   70|           g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
libblockdev-3.4.0/src/plugins/fs/generic.c: scope_hint: In function 'bd_fs_get_fstype'
libblockdev-3.4.0/src/plugins/fs/generic.c:582:38: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 524288)'
#  580|       /* we may need to try multiple times with some delays in case the device is
#  581|          busy at the very moment */
#  582|->     for (n_try=5, status=-1; (status != 0) && (n_try > 0); n_try--) {
#  583|           status = blkid_probe_set_device (probe, fd, 0, 0);
#  584|           if (status != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
libblockdev-3.4.0/src/plugins/fs/mount.c: scope_hint: In function 'do_unmount'
libblockdev-3.4.0/src/plugins/fs/mount.c:151:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  149|       gboolean success = FALSE;
#  150|   
#  151|->     cxt = mnt_new_context ();
#  152|   
#  153|       if (mnt_context_set_target (cxt, args->spec) != 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
libblockdev-3.4.0/src/plugins/fs/mount.c:153:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  151|       cxt = mnt_new_context ();
#  152|   
#  153|->     if (mnt_context_set_target (cxt, args->spec) != 0) {
#  154|           g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  155|                        "Failed to set '%s' as target for umount", args->spec);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
libblockdev-3.4.0/src/plugins/fs/mount.c:154:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  152|   
#  153|       if (mnt_context_set_target (cxt, args->spec) != 0) {
#  154|->         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  155|                        "Failed to set '%s' as target for umount", args->spec);
#  156|           mnt_free_context (cxt);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
libblockdev-3.4.0/src/plugins/fs/mount.c:156:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  154|           g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  155|                        "Failed to set '%s' as target for umount", args->spec);
#  156|->         mnt_free_context (cxt);
#  157|           return FALSE;
#  158|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
libblockdev-3.4.0/src/plugins/fs/mount.c:161:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  159|   
#  160|       if (args->lazy) {
#  161|->         if (mnt_context_enable_lazy (cxt, TRUE) != 0) {
#  162|               g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  163|                            "Failed to set lazy unmount for '%s'", args->spec);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
libblockdev-3.4.0/src/plugins/fs/mount.c:162:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  160|       if (args->lazy) {
#  161|           if (mnt_context_enable_lazy (cxt, TRUE) != 0) {
#  162|->             g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  163|                            "Failed to set lazy unmount for '%s'", args->spec);
#  164|               mnt_free_context (cxt);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
libblockdev-3.4.0/src/plugins/fs/mount.c: scope_hint: In function 'do_mount'
libblockdev-3.4.0/src/plugins/fs/mount.c:380:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  378|       gboolean success = FALSE;
#  379|   
#  380|->     cxt = mnt_new_context ();
#  381|   
#  382|       if (!args->mountpoint && !args->device) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
libblockdev-3.4.0/src/plugins/fs/mount.c:383:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  381|   
#  382|       if (!args->mountpoint && !args->device) {
#  383|->         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  384|                        "You must specify at least one of: mount point, device.");
#  385|           mnt_free_context (cxt);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def39]
libblockdev-3.4.0/src/plugins/fs/mount.c:385:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  383|           g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  384|                        "You must specify at least one of: mount point, device.");
#  385|->         mnt_free_context (cxt);
#  386|           return FALSE;
#  387|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
libblockdev-3.4.0/src/plugins/fs/mount.c:390:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  388|   
#  389|       if (args->mountpoint) {
#  390|->         if (mnt_context_set_target (cxt, args->mountpoint) != 0) {
#  391|               g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  392|                            "Failed to set '%s' as target for mount", args->mountpoint);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
libblockdev-3.4.0/src/plugins/fs/mount.c:391:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  389|       if (args->mountpoint) {
#  390|           if (mnt_context_set_target (cxt, args->mountpoint) != 0) {
#  391|->             g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  392|                            "Failed to set '%s' as target for mount", args->mountpoint);
#  393|               mnt_free_context (cxt);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
libblockdev-3.4.0/src/plugins/fs/mount.c:393:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  391|               g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  392|                            "Failed to set '%s' as target for mount", args->mountpoint);
#  393|->             mnt_free_context (cxt);
#  394|               return FALSE;
#  395|           }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
libblockdev-3.4.0/src/plugins/fs/mount.c: scope_hint: In function 'set_ruid'
libblockdev-3.4.0/src/plugins/fs/mount.c:455:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  453|   static gboolean set_ruid (uid_t uid, GError **error) {
#  454|       if (setresuid (uid, -1, -1) != 0) {
#  455|->         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  456|                        "Error setting ruid: %m");
#  457|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
libblockdev-3.4.0/src/plugins/fs/mount.c: scope_hint: In function 'set_rgid'
libblockdev-3.4.0/src/plugins/fs/mount.c:465:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  463|   static gboolean set_rgid (gid_t gid, GError **error) {
#  464|       if (setresgid (gid, -1, -1) != 0) {
#  465|->         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  466|                        "Error setting rgid: %m");
#  467|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
libblockdev-3.4.0/src/plugins/fs/mount.c:513:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  511|   
#  512|       if (pid == -1) {
#  513|->         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  514|                        "Error forking.");
#  515|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
libblockdev-3.4.0/src/plugins/fs/mount.c:513:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  511|   
#  512|       if (pid == -1) {
#  513|->         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  514|                        "Error forking.");
#  515|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
libblockdev-3.4.0/src/plugins/fs/mount.c:517:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  515|           return FALSE;
#  516|       } else if (pid == 0) {
#  517|->         close (pipefd[0]);
#  518|   
#  519|           if (run_as_gid != current_gid) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
libblockdev-3.4.0/src/plugins/fs/mount.c:517:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  515|           return FALSE;
#  516|       } else if (pid == 0) {
#  517|->         close (pipefd[0]);
#  518|   
#  519|           if (run_as_gid != current_gid) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
libblockdev-3.4.0/src/plugins/fs/mount.c:521:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  519|           if (run_as_gid != current_gid) {
#  520|               if (!set_rgid (run_as_gid, error)) {
#  521|->                 if (write(pipefd[1], (*error)->message, strlen((*error)->message)) < 0)
#  522|                       _exit (BD_FS_ERROR_PIPE);
#  523|                   else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
libblockdev-3.4.0/src/plugins/fs/mount.c:530:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  528|           if (run_as_uid != current_uid) {
#  529|               if (!set_ruid (run_as_uid, error)) {
#  530|->                 if (write(pipefd[1], (*error)->message, strlen((*error)->message)) < 0)
#  531|                       _exit (BD_FS_ERROR_PIPE);
#  532|                   else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
libblockdev-3.4.0/src/plugins/fs/mount.c:547:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[1]'
#  545|   
#  546|       } else {
#  547|->         close (pipefd[1]);
#  548|   
#  549|           do {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
libblockdev-3.4.0/src/plugins/fs/mount.c:547:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[status]'
#  545|   
#  546|       } else {
#  547|->         close (pipefd[1]);
#  548|   
#  549|           do {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
libblockdev-3.4.0/src/plugins/fs/mount.c:550:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
/usr/include/stdlib.h:45: included_from: Included from here.
/usr/include/glib-2.0/glib/gutils.h:426: included_from: Included from here.
/usr/include/glib-2.0/glib/gthread.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib/gasyncqueue.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:34: included_from: Included from here.
#  548|   
#  549|           do {
#  550|->             wpid = waitpid (pid, &status, WUNTRACED | WCONTINUED);
#  551|               if (wpid == -1) {
#  552|                   g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
libblockdev-3.4.0/src/plugins/fs/mount.c:550:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[status]'
#  548|   
#  549|           do {
#  550|->             wpid = waitpid (pid, &status, WUNTRACED | WCONTINUED);
#  551|               if (wpid == -1) {
#  552|                   g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
libblockdev-3.4.0/src/plugins/fs/mount.c:552:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  550|               wpid = waitpid (pid, &status, WUNTRACED | WCONTINUED);
#  551|               if (wpid == -1) {
#  552|->                 g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  553|                                "Error while waiting for process.");
#  554|                   close (pipefd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
libblockdev-3.4.0/src/plugins/fs/mount.c:554:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  552|                   g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  553|                                "Error while waiting for process.");
#  554|->                 close (pipefd[0]);
#  555|                   return FALSE;
#  556|               }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
libblockdev-3.4.0/src/plugins/fs/mount.c:561:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  559|                 if (WEXITSTATUS (status) != EXIT_SUCCESS) {
#  560|                     if (WEXITSTATUS (status) == BD_FS_ERROR_PIPE) {
#  561|->                       g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  562|                                      "Error while reading error.");
#  563|                         close (pipefd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
libblockdev-3.4.0/src/plugins/fs/mount.c:563:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  561|                         g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  562|                                      "Error while reading error.");
#  563|->                       close (pipefd[0]);
#  564|                         return FALSE;
#  565|                     }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
libblockdev-3.4.0/src/plugins/fs/mount.c:567:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  565|                     }
#  566|   
#  567|->                   channel = g_io_channel_unix_new (pipefd[0]);
#  568|                     if (g_io_channel_read_to_end (channel, &error_msg, &msglen, &local_error) != G_IO_STATUS_NORMAL) {
#  569|                         if (local_error) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
libblockdev-3.4.0/src/plugins/fs/mount.c:606:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  604|                     return FALSE;
#  605|                 } else {
#  606|->                   close (pipefd[0]);
#  607|                     return TRUE;
#  608|                 }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
libblockdev-3.4.0/src/plugins/fs/mount.c:610:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  608|                 }
#  609|               } else if (WIFSIGNALED (status)) {
#  610|->                 g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  611|                                "Killed by signal %d.", WTERMSIG(status));
#  612|                   close (pipefd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
libblockdev-3.4.0/src/plugins/fs/mount.c:612:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd[0]'
#  610|                   g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL,
#  611|                                "Killed by signal %d.", WTERMSIG(status));
#  612|->                 close (pipefd[0]);
#  613|                   return FALSE;
#  614|               }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
libblockdev-3.4.0/src/plugins/loop.c: scope_hint: In function 'bd_loop_error_quark'
libblockdev-3.4.0/src/plugins/loop.c:52:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#   50|   GQuark bd_loop_error_quark (void)
#   51|   {
#   52|->     return g_quark_from_static_string ("g-bd-loop-error-quark");
#   53|   }
#   54|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def64]
libblockdev-3.4.0/src/plugins/loop.c: scope_hint: In function 'bd_loop_setup_from_fd'
libblockdev-3.4.0/src/plugins/loop.c:303:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#  301|       GError *l_error = NULL;
#  302|   
#  303|->     progress_id = bd_utils_report_started ("Started setting up loop device");
#  304|   
#  305|       loop_control_fd = open ("/dev/loop-control", O_RDWR);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
libblockdev-3.4.0/src/plugins/loop.c:305:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#  303|       progress_id = bd_utils_report_started ("Started setting up loop device");
#  304|   
#  305|->     loop_control_fd = open ("/dev/loop-control", O_RDWR);
#  306|       if (loop_control_fd == -1) {
#  307|           g_set_error (&l_error, BD_LOOP_ERROR, BD_LOOP_ERROR_FAIL,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def66]
libblockdev-3.4.0/src/plugins/loop.c:307:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#  305|       loop_control_fd = open ("/dev/loop-control", O_RDWR);
#  306|       if (loop_control_fd == -1) {
#  307|->         g_set_error (&l_error, BD_LOOP_ERROR, BD_LOOP_ERROR_FAIL,
#  308|                        "Failed to open the loop-control device: %m");
#  309|           bd_utils_report_finished (progress_id, l_error->message);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
libblockdev-3.4.0/src/plugins/loop.c:309:55: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#  307|           g_set_error (&l_error, BD_LOOP_ERROR, BD_LOOP_ERROR_FAIL,
#  308|                        "Failed to open the loop-control device: %m");
#  309|->         bd_utils_report_finished (progress_id, l_error->message);
#  310|           g_propagate_error (error, l_error);
#  311|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def68]
libblockdev-3.4.0/src/plugins/loop.c:316:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/loop-control", 2)'
#  314|       /* XXX: serialize access to loop-control (seems to be required, but it's not
#  315|               documented anywhere) */
#  316|->     g_mutex_lock (&loop_control_lock);
#  317|       loop_number = ioctl (loop_control_fd, LOOP_CTL_GET_FREE);
#  318|       g_mutex_unlock (&loop_control_lock);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
libblockdev-3.4.0/src/plugins/loop.c:316:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#  314|       /* XXX: serialize access to loop-control (seems to be required, but it's not
#  315|               documented anywhere) */
#  316|->     g_mutex_lock (&loop_control_lock);
#  317|       loop_number = ioctl (loop_control_fd, LOOP_CTL_GET_FREE);
#  318|       g_mutex_unlock (&loop_control_lock);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def70]
libblockdev-3.4.0/src/plugins/loop.c:318:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 2)'
#  316|       g_mutex_lock (&loop_control_lock);
#  317|       loop_number = ioctl (loop_control_fd, LOOP_CTL_GET_FREE);
#  318|->     g_mutex_unlock (&loop_control_lock);
#  319|       close (loop_control_fd);
#  320|       if (loop_number < 0) {

Error: GCC_ANALYZER_WARNING (CWE-787): [#def71]
libblockdev-3.4.0/src/plugins/nvme/nvme-error.c: scope_hint: In function '_nvme_fabrics_errno_to_gerror'
libblockdev-3.4.0/src/plugins/nvme/nvme-error.c:108:9: warning[-Wanalyzer-out-of-bounds]: buffer over-read
libblockdev-3.4.0/src/plugins/nvme/nvme-error.c:108:9: note: valid subscripts for 'CSWTCH' are '[0]' to '[16]'
#  106|   
#  107|       if (_errno >= ENVME_CONNECT_RESOLVE) {
#  108|->         switch (_errno) {
#  109|               case ENVME_CONNECT_ADDRFAM:
#  110|               case ENVME_CONNECT_TRADDR:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def72]
libblockdev-3.4.0/src/plugins/nvme/nvme-info.c: scope_hint: In function '_nvme_alloc.part.0'
libblockdev-3.4.0/src/plugins/nvme/nvme-info.c:406:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor '_open_dev(device,  error)'
libblockdev-3.4.0/src/plugins/nvme/nvme-info.c:410:19: note: in expansion of macro 'ROUND_UP'
libblockdev-3.4.0/src/plugins/nvme/nvme-info.c:410:19: note: in expansion of macro 'ROUND_UP'
#  404|   
#  405|   /* backported from nvme-cli: https://github.com/linux-nvme/nvme-cli/pull/2051 */
#  406|-> #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
#  407|   
#  408|   void *_nvme_alloc (size_t len, GError **error)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
libblockdev-3.4.0/src/plugins/nvme/nvme-info.c: scope_hint: In function 'bd_nvme_get_namespace_info'
libblockdev-3.4.0/src/plugins/nvme/nvme-info.c:614:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor '_open_dev(device,  error)'
#  612|   
#  613|       /* get Namespace Identifier (NSID) for the @device (NVME_IOCTL_ID) */
#  614|->     ret = nvme_get_nsid (fd, &nsid);
#  615|       if (ret != 0) {
#  616|           _nvme_status_to_error (ret, FALSE, error);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
libblockdev-3.4.0/src/plugins/part.c: scope_hint: In function 'bd_part_delete_part'
libblockdev-3.4.0/src/plugins/part.c:1367:55: warning[-Wanalyzer-null-dereference]: dereference of NULL 'l_error'
# 1365|       part_num = get_part_num (part, &l_error);
# 1366|       if (part_num == -1) {
# 1367|->         bd_utils_report_finished (progress_id, l_error->message);
# 1368|           g_propagate_error (error, l_error);
# 1369|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def75]
libblockdev-3.4.0/src/plugins/part.c: scope_hint: In function 'bd_part_resize_part'
libblockdev-3.4.0/src/plugins/part.c:1529:55: warning[-Wanalyzer-null-dereference]: dereference of NULL 'l_error'
# 1527|       part_num = get_part_num (part, &l_error);
# 1528|       if (part_num == -1) {
# 1529|->         bd_utils_report_finished (progress_id, l_error->message);
# 1530|           g_propagate_error (error, l_error);
# 1531|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def76]
libblockdev-3.4.0/src/plugins/part.c: scope_hint: In function 'bd_part_set_part_type'
libblockdev-3.4.0/src/plugins/part.c:1926:55: warning[-Wanalyzer-null-dereference]: dereference of NULL 'l_error'
# 1924|       part_num = get_part_num (part, &l_error);
# 1925|       if (part_num == -1) {
# 1926|->         bd_utils_report_finished (progress_id, l_error->message);
# 1927|           g_propagate_error (error, l_error);
# 1928|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def77]
libblockdev-3.4.0/src/plugins/part.c: scope_hint: In function 'bd_part_set_part_id'
libblockdev-3.4.0/src/plugins/part.c:1985:55: warning[-Wanalyzer-null-dereference]: dereference of NULL 'l_error'
# 1983|       part_num = get_part_num (part, &l_error);
# 1984|       if (part_num == -1) {
# 1985|->         bd_utils_report_finished (progress_id, l_error->message);
# 1986|           g_propagate_error (error, l_error);
# 1987|           return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def78]
libblockdev-3.4.0/src/plugins/swap.c: scope_hint: In function 'bd_swap_swapon'
libblockdev-3.4.0/src/plugins/swap.c:206:38: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 524288)'
#  204|       /* we may need to try multiple times with some delays in case the device is
#  205|          busy at the very moment */
#  206|->     for (n_try=5, status=-1; (status != 0) && (n_try > 0); n_try--) {
#  207|           status = blkid_probe_set_device (probe, fd, 0, 0);
#  208|           if (status != 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def79]
libblockdev-3.4.0/src/utils/logging.c: scope_hint: In function 'bd_utils_log_format'
libblockdev-3.4.0/src/utils/logging.c:92:15: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
#   90|       if (log_func && level <= log_level) {
#   91|           va_start (args, format);
#   92|->         ret = g_vasprintf (&msg, format, args);
#   93|           va_end (args);
#   94|   

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-229.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibblockdev-3.4.0-99.20260113083332766364.master.49.gfabc60c9
store-results-to/tmp/tmp1zkj4muo/libblockdev-3.4.0-99.20260113083332766364.master.49.gfabc60c9.tar.xz
time-created2026-01-13 12:58:14
time-finished2026-01-13 13:02:33
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp1zkj4muo/libblockdev-3.4.0-99.20260113083332766364.master.49.gfabc60c9.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp1zkj4muo/libblockdev-3.4.0-99.20260113083332766364.master.49.gfabc60c9.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9