libgtop2-2.41.3-1.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/first.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def2]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/first.c:55:2: warning[deadcode.DeadStores]: Value stored to 'count' is never read
#   53|   	char *args;
#   54|   
#   55|-> 	count = PROFILE_COUNT;
#   56|   
#   57|   	setlocale (LC_ALL, "");

Error: CLANG_WARNING: [#def3]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/netload.c:74:2: warning[deadcode.DeadStores]: Value stored to 'count' is never read
#   72|   	char buffer [BUFSIZ];
#   73|   
#   74|-> 	count = PROFILE_COUNT;
#   75|   
#   76|   	setlocale (LC_ALL, "");

Error: CPPCHECK_WARNING: [#def4]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/procmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def5]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/procmap.c:81:2: warning[deadcode.DeadStores]: Value stored to 'count' is never read
#   79|   	pid_t pid;
#   80|   
#   81|-> 	count = PROFILE_COUNT;
#   82|   
#   83|   	setlocale (LC_ALL, "");

Error: CLANG_WARNING: [#def6]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/sysdeps.c:48:2: warning[deadcode.DeadStores]: Value stored to 'count' is never read
#   46|   	char buffer [BUFSIZ];
#   47|   
#   48|-> 	count = PROFILE_COUNT;
#   49|   
#   50|   	setlocale (LC_ALL, "");

Error: COMPILER_WARNING (CWE-252): [#def7]
libgtop2-2.41.3-build/libgtop-2.41.3/examples/timings.c: scope_hint: In function ‘display_self_times’
libgtop2-2.41.3-build/libgtop-2.41.3/examples/timings.c:81:9: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#   81 |         system("ps xjf | egrep 'timings|libgtop_server'");
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   79|   	printf("-- this server is %8u ----------------"
#   80|   	       "---------------\n", (unsigned)glibtop_global_server->pid);
#   81|-> 	system("ps xjf | egrep 'timings|libgtop_server'");
#   82|   	printf("-------------------------------------------"
#   83|   	       "---------------\n");

Error: CPPCHECK_WARNING: [#def8]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c: scope_hint: In function '_init_server'
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c:69:36: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
/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.
libgtop2-2.41.3-build/libgtop-2.41.3/glibtop.h:29: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c:23: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c:51:42: note: in expansion of macro 'g_strdup'
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c: scope_hint: In function '_init_server'
#   67|   	 * the full pathname of the server executable. */
#   68|   
#   69|-> 	if (server->server_command [0] != ':') {
#   70|   		if (features & glibtop_server_features) {
#   71|   			/* We really need the server. */

Error: CLANG_WARNING: [#def10]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/init.c:134:4: warning[deadcode.DeadStores]: Value stored to 'temp' is never read
#  132|   				server->server_port = DEFAULT_PORT;
#  133|   
#  134|-> 			temp = temp2 ? temp2 + 1 : temp2;
#  135|   		}
#  136|   

Error: CLANG_WARNING: [#def11]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/open.c:63:3: warning[deadcode.DeadStores]: Value stored to 'connect_type' is never read
#   61|   			 server->server_host, server->server_port);
#   62|   
#   63|-> 		connect_type = glibtop_make_connection
#   64|   			(server->server_host, server->server_port,
#   65|   			 &server->socket);

Error: CLANG_WARNING: [#def12]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/open.c:76:3: warning[deadcode.DeadStores]: Value stored to 'connect_type' is never read
#   74|   		glibtop_debug ("Connecting to Unix Domain Socket.");
#   75|   
#   76|-> 		connect_type = glibtop_make_connection
#   77|   			("unix", 0, &server->socket);
#   78|   

Error: GCC_ANALYZER_WARNING: [#def13]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/open.c: scope_hint: In function 'glibtop_open_l'
libgtop2-2.41.3-build/libgtop-2.41.3/lib/open.c:99:25: warning[-Wanalyzer-fd-use-without-check]: 'dup2' on possibly invalid file descriptor '1'
#   97|   			close (0); close (1);
#   98|   			close (server->input [0]); close (server->output [1]);
#   99|-> 			dup2 (server->input [1], 1);
#  100|   			dup2 (server->output [0], 0);
#  101|   			execl (server->server_command, "libgtop-server", NULL);

Error: GCC_ANALYZER_WARNING: [#def14]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/open.c:100:25: warning[-Wanalyzer-fd-use-without-check]: 'dup2' on possibly invalid file descriptor '0'
#   98|   			close (server->input [0]); close (server->output [1]);
#   99|   			dup2 (server->input [1], 1);
#  100|-> 			dup2 (server->output [0], 0);
#  101|   			execl (server->server_command, "libgtop-server", NULL);
#  102|   			glibtop_error_io_r (server, "execl (%s)",

Error: CPPCHECK_WARNING: [#def15]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/tmp-introspectuj7ep59q/GTop-2.0.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def16]
libgtop2-2.41.3-build/libgtop-2.41.3/lib/tmp-introspectuj7ep59q/GTop-2.0.c:799:27: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')

Error: CPPCHECK_WARNING: [#def17]
libgtop2-2.41.3-build/libgtop-2.41.3/src/daemon/gnuserv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING: [#def18]
libgtop2-2.41.3-build/libgtop-2.41.3/src/daemon/gnuserv.c: scope_hint: In function ‘syslog_io_message’
libgtop2-2.41.3-build/libgtop-2.41.3/src/daemon/gnuserv.c:109:37: warning[-Wformat-truncation=]: ‘: ’ directive output may be truncated writing 2 bytes into a region of size between 0 and 8191
#  109 |     snprintf (buffer2, BUFSIZ-1, "%s: %s", buffer, g_strerror (errno));
#      |                                     ^~
/usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 3 or more bytes (assuming 8194) into a destination of size 8191
#   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   69 |                                    __glibc_objsize (__s), __fmt,
#      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   70 |                                    __va_arg_pack ());
#      |                                    ~~~~~~~~~~~~~~~~~
#  107|       va_end (ap);
#  108|   
#  109|->     snprintf (buffer2, BUFSIZ-1, "%s: %s", buffer, g_strerror (errno));
#  110|       syslog (priority, "%s", buffer2);
#  111|   }

Error: CLANG_WARNING: [#def19]
libgtop2-2.41.3-build/libgtop-2.41.3/src/daemon/gnuserv.c:288:10: warning[deadcode.DeadStores]: Although the value stored to 'host_addr' is used in the enclosing expression, the value is never actually read from 'host_addr'
#  286|       gethostname (hostname, HOSTNAMSZ);
#  287|   
#  288|->     if ((host_addr = glibtop_internet_addr (hostname)) == -1) {
#  289|   	syslog_io_message (LOG_ERR, "Can't resolve '%s'", hostname);
#  290|   	exit (1);

Error: CPPCHECK_WARNING: [#def20]
libgtop2-2.41.3-build/libgtop-2.41.3/src/daemon/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def21]
libgtop2-2.41.3-build/libgtop-2.41.3/src/daemon/slave.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-252): [#def22]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/gnuslib.c: scope_hint: In function 'connect_to_internet_server'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/gnuslib.c:299:9: warning[-Wunused-result]: ignoring return value of 'write' declared with attribute 'warn_unused_result'
#  299 |         write (s, buf, strlen (buf));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  297|   
#  298|   	sprintf (buf, "%s\n", DEFAUTH_NAME);
#  299|-> 	write (s, buf, strlen (buf));
#  300|   
#  301|   	return (s);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def23]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/procargs.c: scope_hint: In function 'split_args0'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/procargs.c:20:56: warning[-Wanalyzer-null-argument]: use of NULL 'arg' 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.
libgtop2-2.41.3-build/libgtop-2.41.3/glibtop.h:29: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/include/glibtop/procargs.h:25: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/procargs.c:2: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/procargs.c:21:39: note: in expansion of macro 'g_strdup'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/common/procargs.c: scope_hint: In function 'split_args0'
<built-in>: note: argument 1 of '__builtin_strlen' must be non-null
#   18|   
#   19|   	/* remember that if there were no args, args0 == NULL and size == 0 */
#   20|-> 	for (arg = args0; arg < (args0 + size); arg += strlen(arg) + 1) {
#   21|   		g_ptr_array_add(argv, g_strdup(arg));
#   22|   	}

Error: CPPCHECK_WARNING: [#def24]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/disk.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING: [#def25]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/disk.c: scope_hint: In function 'glibtop_get_disk_s'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/disk.c:164:17: warning[-Wstringop-truncation]: '__strncpy_chk' output may be truncated copying 4 bytes from a string of length 255
#  164 |                 strncpy (primary_part[n].type, type, 4);
#      |                 ^
#  162|   
#  163|   		strcpy (primary_part[n].name, name);
#  164|-> 		strncpy (primary_part[n].type, type, 4);
#  165|   		
#  166|   		if (strcmp (primary_part[n].type, "raid") == 0) {

Error: CPPCHECK_WARNING: [#def26]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/glibtop_private.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/glibtop_private.c: scope_hint: In function 'get_from_pipe'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/glibtop_private.c:67:24: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'popen(cmd, "r")' where non-null expected
libgtop2-2.41.3-build/libgtop-2.41.3/include/glibtop/global.h:36: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/glibtop.h:59: included_from: Included from here.
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/glibtop_private.c:2: included_from: Included from here.
/usr/include/stdio.h:728:15: note: argument 4 of 'fread' must be non-null
#   65|   	fp = popen (cmd, "r");
#   66|   
#   67|-> 	size_t psize = fread(buffer,1,bufsiz,fp);
#   68|   	if (psize == bufsiz)
#   69|   		g_warning("Read bufsiz bytes, there may be more");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/glibtop_private.h:40:32: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
/usr/include/glib-2.0/glib/gstrfuncs.h:86:29: note: in definition of macro 'g_ascii_isspace'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/procstate.c: scope_hint: In function 'glibtop_get_proc_state_s'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/procstate.c:27: included_from: Included from here.
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro '_G_BOOLEAN_EXPR_IMPL'
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro '_G_BOOLEAN_EXPR'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/glibtop_private.h:118:13: note: in expansion of macro 'G_LIKELY'
/usr/include/glib-2.0/glib/gstrfuncs.h:86:29: note: in definition of macro 'g_ascii_isspace'
#   38|   next_token(const char *p)
#   39|   {
#   40|-> 	while (g_ascii_isspace(*p)) p++;
#   41|   	return (char*) p;
#   42|   }

Error: CPPCHECK_WARNING: [#def29]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/mountlist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def30]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-252): [#def31]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c: scope_hint: In function 'linux_2_0_stats'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c:275:5: warning[-Wunused-result]: ignoring return value of 'fgets' declared with attribute 'warn_unused_result'
#  275 |     fgets (buffer, BUFSIZ-1, f);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  273|   
#  274|       /* Skip over the header line. */
#  275|->     fgets (buffer, BUFSIZ-1, f);
#  276|   
#  277|       while (fgets (buffer, BUFSIZ-1, f)) {

Error: COMPILER_WARNING (CWE-252): [#def32]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c: scope_hint: In function 'linux_2_4_stats'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c:356:5: warning[-Wunused-result]: ignoring return value of 'fgets' declared with attribute 'warn_unused_result'
#  356 |     fgets (buffer, BUFSIZ-1, f);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  354|   
#  355|       /* Skip over the header line. */
#  356|->     fgets (buffer, BUFSIZ-1, f);
#  357|       fgets (buffer, BUFSIZ-1, f);
#  358|   

Error: COMPILER_WARNING (CWE-252): [#def33]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c:357:5: warning[-Wunused-result]: ignoring return value of 'fgets' declared with attribute 'warn_unused_result'
#  357 |     fgets (buffer, BUFSIZ-1, f);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  355|       /* Skip over the header line. */
#  356|       fgets (buffer, BUFSIZ-1, f);
#  357|->     fgets (buffer, BUFSIZ-1, f);
#  358|   
#  359|       /* Starting with 2.1.xx (don't know exactly which version)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c: scope_hint: In function 'glibtop_get_netload_s'
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/netload.c:558:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'skfd'
#  556|       get_ipv6(server, buf, interface);
#  557|   #endif /* HAVE_IFADDRS_H */
#  558|-> }
#  559|   
#  560|   

Error: CPPCHECK_WARNING: [#def35]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/ppp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def36]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/ppp.c:144:9: warning[deadcode.DeadStores]: Value stored to 'end' during its initialization is never read
#  142|   
#  143|   	while (*p) {
#  144|-> 		char *end = p;
#  145|   
#  146|   		if (isspace (*p)) {

Error: CPPCHECK_WARNING: [#def37]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/proclist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def38]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/procmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def39]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/procopenfiles.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def40]
libgtop2-2.41.3-build/libgtop-2.41.3/sysdeps/linux/suid_open.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

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
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-214.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibgtop2-2.41.3-1.fc41
store-results-to/tmp/tmpazvej6h2/libgtop2-2.41.3-1.fc41.tar.xz
time-created2024-07-03 14:46:44
time-finished2024-07-03 14:47:58
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpazvej6h2/libgtop2-2.41.3-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpazvej6h2/libgtop2-2.41.3-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9