guestfs-tools-1.53.4-1.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c: scope_hint: In function ‘yyparse’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:507:21: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:127:40: note: in definition of macro ‘YY_CAST’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:493:25: note: in expansion of macro ‘YYMALLOC’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1232:20: note: in expansion of macro ‘YYSTACK_ALLOC’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1305:17: note: in expansion of macro ‘YYTRANSLATE’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:127:40: note: in definition of macro ‘YY_CAST’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:493:25: note: in expansion of macro ‘YYMALLOC’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1232:20: note: in expansion of macro ‘YYSTACK_ALLOC’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:555:9: note: in expansion of macro ‘YYCOPY’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1235:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:127:40: note: in definition of macro ‘YY_CAST’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:493:25: note: in expansion of macro ‘YYMALLOC’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1232:20: note: in expansion of macro ‘YYSTACK_ALLOC’
#  505|   #  endif
#  506|   #  ifndef YYMALLOC
#  507|-> #   define YYMALLOC malloc
#  508|   #   if ! defined malloc && ! defined EXIT_SUCCESS
#  509|   void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:570:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:555:9: note: in expansion of macro ‘YYCOPY’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1235:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:555:9: note: in expansion of macro ‘YYCOPY’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1235:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:555:9: note: in expansion of macro ‘YYCOPY’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1235:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
#  568|   #  if defined __GNUC__ && 1 < __GNUC__
#  569|   #   define YYCOPY(Dst, Src, Count) \
#  570|->       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  571|   #  else
#  572|   #   define YYCOPY(Dst, Src, Count)              \

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.y: scope_hint: In function ‘concat_newline’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.y:59:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1305:17: note: in expansion of macro ‘YYTRANSLATE’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#   57|     len = len1 + 1 /* \n */ + len2 + 1 /* \0 */;
#   58|     ret = malloc (len);
#   59|->   memcpy (ret, str1, len1);
#   60|     ret[len1] = '\n';
#   61|     memcpy (ret + len1 + 1, str2, len2);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.y:124:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(24)’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parse.c:1305:17: note: in expansion of macro ‘YYTRANSLATE’
#  122|         SECTION_HEADER fields
#  123|           { $$ = malloc (sizeof (struct section));
#  124|->           $$->next = NULL;
#  125|             $$->name = $1;
#  126|             $$->fields = $2; }

Error: CPPCHECK_WARNING (CWE-415): [#def5]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-parser-c.c:69: error[doubleFree]: Resource handle 'in' freed twice.
#   67|     }
#   68|   
#   69|->   if (fclose (in) == EOF)
#   70|       unix_error (errno, (char *) "fclose", filenamev);
#   71|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c: scope_hint: In function ‘yy_create_buffer’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c:1550:12: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c: scope_hint: In function ‘yy_create_buffer’
# 1548|   	 * we need to put in 2 end-of-buffer characters.
# 1549|   	 */
# 1550|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1551|   	if ( ! b->yy_ch_buf )
# 1552|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c: scope_hint: In function ‘yy_init_buffer’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c:1592:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c:1402:41: note: in expansion of macro ‘YY_CURRENT_BUFFER_LVALUE’
# 1590|   
# 1591|   	yy_flush_buffer( b , yyscanner);
# 1592|-> 
# 1593|   	b->yy_input_file = file;
# 1594|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c: scope_hint: In function ‘yy_scan_buffer’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c:1810:38: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/builder/index-scan.c: scope_hint: In function ‘yy_scan_buffer’
# 1808|   	for ( i = 0; i < _yybytes_len; ++i )
# 1809|   		buf[i] = yybytes[i];
# 1810|-> 
# 1811|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1812|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/filesystems.c: scope_hint: In function ‘do_output_blockdevs’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/filesystems.c:768:10: warning[-Wanalyzer-malloc-leak]: leak of ‘no_parents()’
#  766|     ret[0] = NULL;
#  767|   
#  768|->   return ret;
#  769|   }
#  770|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/filesystems.c:797:5: warning[-Wanalyzer-malloc-leak]: leak of ‘parents_of_md(*<unknown>)’
#  795|   
#  796|     CLEANUP_FREE_MDSTAT_LIST struct guestfs_mdstat_list *stats =
#  797|->     guestfs_md_stat (g, device);
#  798|     if (!stats)
#  799|       exit (EXIT_FAILURE);

Error: CPPCHECK_WARNING (CWE-401): [#def11]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/tail.c:286: error[memleak]: Memory leak: file
#  284|     drvt = disk_mtime (drvs);
#  285|     if (drvt == (time_t)-1)
#  286|->     return -1;
#  287|   
#  288|     while (!quit) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/tail.c: scope_hint: In function ‘do_tail’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/tail.c:349:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘file’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/tail.c: scope_hint: In function ‘do_tail’
#  347|           if (guestfs_last_errno (g) == ENOENT) {
#  348|             time (&t);
#  349|->           file[i].mtime = t;
#  350|             file[i].size = 0;
#  351|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def13]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/tail.c:368:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘file’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/cat/tail.c: scope_hint: In function ‘do_tail’
#  366|            * so be careful.
#  367|            */
#  368|->         if (file[i].mtime != stat->st_mtime_sec ||
#  369|               file[i].size != stat->st_size) {
#  370|             /* If we get here, the file changed and we're going to display

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/edit/file-edit.c: scope_hint: In function 'do_upload'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/edit/file-edit.c:326:6: warning[-Wanalyzer-malloc-leak]: leak of 'generate_random_name(guestfs_realpath(g,  fn))'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/edit/file-edit.c:40: included_from: Included from here.
#  324|      * trailing \0.
#  325|      */
#  326|->   if (guestfs_int_random_string (p, 8) == -1) {
#  327|       perror ("guestfs_int_random_string");
#  328|       free (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/edit/file-edit.c: scope_hint: In function ‘do_upload’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/edit/file-edit.c:326:6: warning[-Wanalyzer-malloc-leak]: leak of ‘generate_random_name(guestfs_realpath(g,  fn))’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/edit/file-edit.c:40: included_from: Included from here.
#  324|      * trailing \0.
#  325|      */
#  326|->   if (guestfs_int_random_string (p, 8) == -1) {
#  327|       perror ("guestfs_int_random_string");
#  328|       free (ret);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/mltools/getopt-c.c: scope_hint: In function ‘cleanup_option_list’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/mltools/getopt-c.c:57:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/mltools/getopt-c.c:38: included_from: Included from here.
/usr/lib64/ocaml/caml/memory.h:290:3: note: in expansion of macro ‘CAMLparam0’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/mltools/getopt-c.c:207:3: note: in expansion of macro ‘CAMLparam4’
/usr/lib64/ocaml/caml/memory.h:290:3: note: in expansion of macro ‘CAMLparam0’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/mltools/getopt-c.c:207:3: note: in expansion of macro ‘CAMLparam4’
#   55|     struct option *p = opts;
#   56|   
#   57|->   while (p->name != NULL) {
#   58|       /* Cast the constness away, since we created the names on heap. */
#   59|       free ((char *) p->name);

Error: CPPCHECK_WARNING (CWE-415): [#def17]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/mlvisit/visit-c.c:101: error[doubleFree]: Memory pointed to by 'dir' is freed twice.
#   99|       caml_raise (*caml_named_value ("Visit.Failure"));
#  100|     }
#  101|->   free (dir);
#  102|   
#  103|     CAMLreturn (Val_unit);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c: scope_hint: In function 'decrypt_mountables'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:96:27: warning[-Wanalyzer-malloc-leak]: leak of 'make_mapname(mountable)'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/options.h:26: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:39: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:143:9: note: in expansion of macro 'STREQ'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:32: included_from: Included from here.
#   94|   
#   95|       /* filter & copy */
#   96|->     while ((ichar = device[ipos]) != '\0') {
#   97|         if (c_isalnum (ichar))
#   98|           append_char (&opos, mapname, ichar);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c: scope_hint: In function ‘decrypt_mountables’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:96:27: warning[-Wanalyzer-malloc-leak]: leak of ‘make_mapname(mountable)’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/options.h:26: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:39: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:143:9: note: in expansion of macro ‘STREQ’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:32: included_from: Included from here.
#   94|   
#   95|       /* filter & copy */
#   96|->     while ((ichar = device[ipos]) != '\0') {
#   97|         if (c_isalnum (ichar))
#   98|           append_char (&opos, mapname, ichar);

Error: CPPCHECK_WARNING (CWE-457): [#def20]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/decrypt.c:178: warning[uninitvar]: Uninitialized variable: r
#  176|         guestfs_pop_error_handler (g);
#  177|   
#  178|->       if (r == 0)
#  179|           break;
#  180|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function 'read_key'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:99:10: warning[-Wanalyzer-file-leak]: leak of FILE 'infp'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:27: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:63:21: note: in expansion of macro '_'
#   97|       fclose (infp); /* outfp == infp, so this is closed also */
#   98|   
#   99|->   return ret;
#  100|   }
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function ‘read_key’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:99:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘infp’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:27: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:63:21: note: in expansion of macro ‘_’
#   97|       fclose (infp); /* outfp == infp, so this is closed also */
#   98|   
#   99|->   return ret;
#  100|   }
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:99:10: warning[-Wanalyzer-malloc-leak]: leak of 'infp'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:63:21: note: in expansion of macro '_'
#   97|       fclose (infp); /* outfp == infp, so this is closed also */
#   98|   
#   99|->   return ret;
#  100|   }
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:99:10: warning[-Wanalyzer-malloc-leak]: leak of ‘infp’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:63:21: note: in expansion of macro ‘_’
#   97|       fclose (infp); /* outfp == infp, so this is closed also */
#   98|   
#   99|->   return ret;
#  100|   }
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function 'read_first_line_from_file'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:110:8: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r")'
#  108|     ssize_t len;
#  109|   
#  110|->   fp = fopen (filename, "r");
#  111|     if (!fp)
#  112|       error (EXIT_FAILURE, errno, "fopen: %s", filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function ‘read_first_line_from_file’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:110:8: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
#  108|     ssize_t len;
#  109|   
#  110|->   fp = fopen (filename, "r");
#  111|     if (!fp)
#  112|       error (EXIT_FAILURE, errno, "fopen: %s", filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:110:8: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r")'
#  108|     ssize_t len;
#  109|   
#  110|->   fp = fopen (filename, "r");
#  111|     if (!fp)
#  112|       error (EXIT_FAILURE, errno, "fopen: %s", filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:110:8: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
#  108|     ssize_t len;
#  109|   
#  110|->   fp = fopen (filename, "r");
#  111|     if (!fp)
#  112|       error (EXIT_FAILURE, errno, "fopen: %s", filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function 'key_store_add_from_selector'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:266:1: warning[-Wanalyzer-malloc-leak]: leak of 'key.<U6130>.string.s'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/options.h:26: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:34: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro 'STREQ'
#  264|   
#  265|     return key_store_import_key (ks, &key);
#  266|-> }
#  267|   
#  268|   /* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function 'key_store_add_from_selector'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:266:1: warning[-Wanalyzer-malloc-leak]: leak of 'key.<Ud130>.string.s'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/options.h:26: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:34: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro 'STREQ'
#  264|   
#  265|     return key_store_import_key (ks, &key);
#  266|-> }
#  267|   
#  268|   /* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:266:1: warning[-Wanalyzer-malloc-leak]: leak of 'key.id'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro 'STREQ'
#  264|   
#  265|     return key_store_import_key (ks, &key);
#  266|-> }
#  267|   
#  268|   /* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function ‘key_store_add_from_selector’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:266:1: warning[-Wanalyzer-malloc-leak]: leak of ‘key.<U1130>.string.s’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/options.h:26: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:34: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro ‘STREQ’
#  264|   
#  265|     return key_store_import_key (ks, &key);
#  266|-> }
#  267|   
#  268|   /* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:266:1: warning[-Wanalyzer-malloc-leak]: leak of ‘key.id’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro ‘STREQ’
#  264|   
#  265|     return key_store_import_key (ks, &key);
#  266|-> }
#  267|   
#  268|   /* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function 'key_store_add_from_selector'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:380:26: warning[-Wanalyzer-malloc-leak]: leak of 'key_store_import_key(ks, & key)'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro 'STREQ'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:249:14: note: in expansion of macro 'STREQ'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:258:14: note: in expansion of macro 'STREQ'
#  378|   
#  379|     new_keys = realloc (ks->keys,
#  380|->                       (ks->nr_keys + 1) * sizeof (struct key_store_key));
#  381|     if (!new_keys)
#  382|       error (EXIT_FAILURE, errno, "realloc");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c: scope_hint: In function ‘key_store_add_from_selector’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:380:26: warning[-Wanalyzer-malloc-leak]: leak of ‘key_store_import_key(ks, & key)’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro ‘STREQ’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:249:14: note: in expansion of macro ‘STREQ’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:258:14: note: in expansion of macro ‘STREQ’
#  378|   
#  379|     new_keys = realloc (ks->keys,
#  380|->                       (ks->nr_keys + 1) * sizeof (struct key_store_key));
#  381|     if (!new_keys)
#  382|       error (EXIT_FAILURE, errno, "realloc");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:389:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro 'STREQ'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:249:14: note: in expansion of macro 'STREQ'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:258:14: note: in expansion of macro 'STREQ'
#  387|     ++ks->nr_keys;
#  388|   
#  389|->   return ks;
#  390|   }
#  391|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:389:10: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:29: note: in definition of macro ‘STREQ’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:249:14: note: in expansion of macro ‘STREQ’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/keys.c:258:14: note: in expansion of macro ‘STREQ’
#  387|     ++ks->nr_keys;
#  388|   
#  389|->   return ks;
#  390|   }
#  391|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/parallel/parallel.c: scope_hint: In function 'worker_thread'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/parallel/parallel.c:181:24: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
#  179|       size_t i;               /* The current domain we're working on. */
#  180|       FILE *fp;
#  181|->     CLEANUP_FREE char *output = NULL;
#  182|       size_t output_len = 0;
#  183|       guestfs_h *g;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c: scope_hint: In function ‘main’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:384:11: warning[-Wanalyzer-malloc-leak]: leak of ‘make_display_name(drvs)’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:32: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:43: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:259:3: note: in expansion of macro ‘CHECK_OPTION_format_consumed’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:259:3: note: in expansion of macro ‘CHECK_OPTION_format_consumed’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:260:3: note: in expansion of macro ‘CHECK_OPTION_blocksize_consumed’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:260:3: note: in expansion of macro ‘CHECK_OPTION_blocksize_consumed’
#  382|   
#  383|     /* Single disk or domain. */
#  384|->   if (drvs->next == NULL)
#  385|       ret = single_drive_display_name (drvs);
#  386|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c: scope_hint: In function ‘make_display_name’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/df/main.c:404:8: warning[-Wanalyzer-malloc-leak]: leak of ‘single_drive_display_name(drvs)’
#  402|   
#  403|       ret = realloc (ret, len + pluses + 1);
#  404|->     if (ret == NULL)
#  405|         error (EXIT_FAILURE, errno, "realloc");
#  406|       for (i = len; i < len + pluses; ++i)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c:40: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c: scope_hint: In function 'parse'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:21: warning[-Wanalyzer-malloc-leak]: leak of 'query_get(xmlParseURI(arg), "socket")'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c:228:17: note: in expansion of macro 'STREQ'
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c:228:17: note: in expansion of macro 'STREQ'
#   48|   #endif
#   49|   
#   50|-> #define STREQ(a,b) (strcmp((a),(b)) == 0)
#   51|   #define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0)
#   52|   #define STRNEQ(a,b) (strcmp((a),(b)) != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/utils/guestfs-utils.h:38: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c:40: included_from: Included from here.
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c: scope_hint: In function ‘parse’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/lib/guestfs-internal-all.h:50:21: warning[-Wanalyzer-malloc-leak]: leak of ‘query_get(xmlParseURI(arg), "socket")’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c:228:17: note: in expansion of macro ‘STREQ’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/common/options/uri.c:228:17: note: in expansion of macro ‘STREQ’
#   48|   #endif
#   49|   
#   50|-> #define STREQ(a,b) (strcmp((a),(b)) == 0)
#   51|   #define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0)
#   52|   #define STRNEQ(a,b) (strcmp((a),(b)) != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def43]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:303: error[memleak]: Memory leak: buffer
#  301|     if (pipe (fd) == -1) {
#  302|       perror ("pipe");
#  303|->     return -1;
#  304|     }
#  305|     pid = fork ();

Error: CPPCHECK_WARNING (CWE-401): [#def44]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:308: error[memleak]: Memory leak: buffer
#  306|     if (pid == -1) {
#  307|       perror ("fork");
#  308|->     return -1;
#  309|     }
#  310|     if (pid > 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c: scope_hint: In function ‘exec_command_count_output’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:343:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#  341|     perror ("execvp");
#  342|     _exit (EXIT_FAILURE);
#  343|-> }
#  344|   
#  345|   /* Execute a command in the background (don't wait) and send the

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:343:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
#  341|     perror ("execvp");
#  342|     _exit (EXIT_FAILURE);
#  343|-> }
#  344|   
#  345|   /* Execute a command in the background (don't wait) and send the

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:356:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#  354|     if (pipe (fd) == -1) {
#  355|       perror ("pipe");
#  356|->     return -1;
#  357|     }
#  358|     *pid_rtn = fork ();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c: scope_hint: In function ‘bg_command’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:356:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
#  354|     if (pipe (fd) == -1) {
#  355|       perror ("pipe");
#  356|->     return -1;
#  357|     }
#  358|     *pid_rtn = fork ();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c: scope_hint: In function ‘estimate_input’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:442:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tmpfile, "r")’
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:35: included_from: Included from here.
#  440|         return -1;
#  441|   
#  442|->     fp = fopen (tmpfile, "r");
#  443|       if (fp == NULL) {
#  444|         perror (tmpfile);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:442:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tmpfile, "r")’
#  440|         return -1;
#  441|   
#  442|->     fp = fopen (tmpfile, "r");
#  443|       if (fp == NULL) {
#  444|         perror (tmpfile);

Error: CPPCHECK_WARNING (CWE-404): [#def51]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:449: error[resourceLeak]: Resource leak: fp
#  447|       if (fgets (line, sizeof line, fp) == NULL) {
#  448|         perror ("fgets");
#  449|->       return -1;
#  450|       }
#  451|   

Error: CPPCHECK_WARNING (CWE-404): [#def52]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:455: error[resourceLeak]: Resource leak: fp
#  453|         fprintf (stderr, _("%s: cannot parse the output of ‘du’ command: %s\n"),
#  454|                  getprogname (), line);
#  455|->       return -1;
#  456|       }
#  457|     }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:467:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tmpfile, "r")’
#  465|         return -1;
#  466|   
#  467|->     fp = fopen (tmpfile, "r");
#  468|       if (fp == NULL) {
#  469|         perror (tmpfile);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:467:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tmpfile, "r")’
#  465|         return -1;
#  466|   
#  467|->     fp = fopen (tmpfile, "r");
#  468|       if (fp == NULL) {
#  469|         perror (tmpfile);

Error: CPPCHECK_WARNING (CWE-404): [#def55]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:474: error[resourceLeak]: Resource leak: fp
#  472|       if (fgets (line, sizeof line, fp) == NULL) {
#  473|         perror ("fgets");
#  474|->       return -1;
#  475|       }
#  476|   

Error: CPPCHECK_WARNING (CWE-404): [#def56]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:484: error[resourceLeak]: Resource leak: fp
#  482|       if (*ifmt_rtn == NULL) {
#  483|         perror ("strdup");
#  484|->       return -1;
#  485|       }
#  486|   

Error: CPPCHECK_WARNING (CWE-404): [#def57]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:490: error[resourceLeak]: Resource leak: fp
#  488|         fprintf (stderr, _("%s: %s: input is not a directory, tar archive or compressed tar archive\n"),
#  489|                  getprogname (), input);
#  490|->       return -1;
#  491|       }
#  492|   

Error: CPPCHECK_WARNING (CWE-404): [#def58]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:521: error[resourceLeak]: Resource leak: fp
#  519|           fprintf (stderr, _("%s: %s: unknown compressed input format (%s)\n"),
#  520|                    getprogname (), input, line);
#  521|->         return -1;
#  522|         }
#  523|   

Error: CPPCHECK_WARNING (CWE-404): [#def59]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:526: error[resourceLeak]: Resource leak: fp
#  524|         *estimate_rtn = 0;
#  525|         if (exec_command_count_output ((char **) argv, estimate_rtn) == -1)
#  526|->         return -1;
#  527|       }
#  528|       else {

Error: CPPCHECK_WARNING (CWE-404): [#def60]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:537: error[resourceLeak]: Resource leak: fp
#  535|     }
#  536|   
#  537|->   return 0;
#  538|   }
#  539|   

Error: CPPCHECK_WARNING (CWE-401): [#def61]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:678: error[memleak]: Memory leak: output
#  676|     /* Input.  What is it?  Estimate how much space it will need. */
#  677|     if (estimate_input (input, &estimate, &ifmt) == -1)
#  678|->     return -1;
#  679|   
#  680|     if (verbose) {

Error: CPPCHECK_WARNING (CWE-401): [#def62]
guestfs-tools-1.53.4-build/guestfs-tools-1.53.4/make-fs/make-fs.c:733: error[memleak]: Memory leak: output
#  731|     else
#  732|       if (parse_size (size_str, estimate, &size) == -1)
#  733|->       return -1;
#  734|   
#  735|     /* Create the output disk. */

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-172.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameguestfs-tools-1.53.4-1.fc42
store-results-to/tmp/tmpaeodng0m/guestfs-tools-1.53.4-1.fc42.tar.xz
time-created2024-11-13 00:10:06
time-finished2024-11-13 00:13:09
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpaeodng0m/guestfs-tools-1.53.4-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpaeodng0m/guestfs-tools-1.53.4-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9