libkcompactdisc-24.05.0-1.fc41

List of Defects

Error: COMPILER_WARNING (CWE-195): [#def1]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/phonon_interface.cpp: scope_hint: In member function ‘virtual unsigned int KPhononCompactDiscPrivate::trackLength(unsigned int)’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/phonon_interface.cpp:146:75: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’
#  146 |     if(!producer() || m_producerWidget->m_mediaController->currentTitle() != track)
#      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
#  144|   unsigned KPhononCompactDiscPrivate::trackLength(unsigned track)
#  145|   {
#  146|->     if(!producer() || m_producerWidget->m_mediaController->currentTitle() != track)
#  147|   		return 0;
#  148|   

Error: COMPILER_WARNING: [#def2]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c:34:9: warning: "_DEFAULT_SOURCE" redefined
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/include/wm_config.h:351: included_from: Included from here.
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c:27: included_from: Included from here.
/usr/include/features.h:246:10: note: this is the location of the previous definition
#   32|   
#   33|   #define _BSD_SOURCE /* strdup */
#   34|-> #define _DEFAULT_SOURCE /* stop glibc whining about the previous line */
#   35|   
#   36|   #include <alsa/asoundlib.h>

Error: COMPILER_WARNING (CWE-477): [#def3]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c: scope_hint: In function ‘set_swparams’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c:192:9: warning[-Wdeprecated-declarations]: ‘snd_pcm_sw_params_set_xfer_align’ is deprecated
/usr/include/alsa/asoundlib.h:56: included_from: Included from here.
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c:36: included_from: Included from here.
/usr/include/alsa/pcm.h:1389:5: note: declared here
#  190|           }
#  191|           /* align all transfers to 1 sample */
#  192|->         err = snd_pcm_sw_params_set_xfer_align(handle, swparams, 1);
#  193|           if (err < 0) {
#  194|                   ERRORLOG("Unable to set transfer align for playback: %s\n", snd_strerror(err));

Error: CLANG_WARNING: [#def4]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c:241:3: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  239|     DEBUGLOG("alsa_close\n");
#  240|   
#  241|->   err = alsa_stop();
#  242|   
#  243|   #if (SND_LIB_MAJOR < 1)

Error: COMPILER_WARNING (CWE-563): [#def5]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c: scope_hint: In function ‘setup_alsa’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/audio/audio_alsa.c:330:41: warning[-Wunused-parameter]: unused parameter ‘ctl’
#  330 | setup_alsa(const char *dev, const char *ctl)
#      |                             ~~~~~~~~~~~~^~~
#  328|   
#  329|   struct audio_oops*
#  330|-> setup_alsa(const char *dev, const char *ctl)
#  331|   {
#  332|     static int init_complete = 0;

Error: CPPCHECK_WARNING: [#def6]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdda.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def7]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-697): [#def8]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c: scope_hint: In function ‘wm_drive_vendor’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:213:30: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘vendor’ will never be NULL
#  213 |         return pdrive->vendor?pdrive->vendor:"";
#      |                              ^
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:31: included_from: Included from here.
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/include/wm_struct.h:147:15: note: ‘vendor’ declared here
#  147 |         char  vendor[9];      /* Vendor name */
#      |               ^~~~~~
#  211|   {
#  212|   	struct wm_drive *pdrive = (struct wm_drive *)p;
#  213|->   	return pdrive->vendor?pdrive->vendor:"";
#  214|   }
#  215|   

Error: COMPILER_WARNING (CWE-697): [#def9]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c: scope_hint: In function ‘wm_drive_model’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:219:29: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘model’ will never be NULL
#  219 |         return pdrive->model?pdrive->model:"";
#      |                             ^
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/include/wm_struct.h:148:15: note: ‘model’ declared here
#  148 |         char  model[17];      /* Drive model */
#      |               ^~~~~
#  217|   {
#  218|   	struct wm_drive *pdrive = (struct wm_drive *)p;
#  219|-> 	return pdrive->model?pdrive->model:"";
#  220|   }
#  221|   

Error: COMPILER_WARNING (CWE-697): [#def10]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c: scope_hint: In function ‘wm_drive_revision’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:225:32: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘revision’ will never be NULL
#  225 |         return pdrive->revision?pdrive->revision:"";
#      |                                ^
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/include/wm_struct.h:149:15: note: ‘revision’ declared here
#  149 |         char  revision[5];    /* Revision of the drive */
#      |               ^~~~~~~~
#  223|   {
#  224|   	struct wm_drive *pdrive = (struct wm_drive *)p;
#  225|-> 	return pdrive->revision?pdrive->revision:"";
#  226|   }
#  227|   

Error: COMPILER_WARNING (CWE-697): [#def11]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c: scope_hint: In function ‘fixup_drive_struct’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:250:39: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘revision’ will never be NULL
#  250 |                         ((d->revision != NULL) && strncmp(driver->revision, d->revision, strlen(d->revision))))
#      |                                       ^~
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/include/wm_struct.h:149:15: note: ‘revision’ declared here
#  149 |         char  revision[5];    /* Revision of the drive */
#      |               ^~~~~~~~
#  248|   		if((strncmp(driver->vendor, d->vendor, strlen(d->vendor))) ||
#  249|   			((driver->model != NULL) && strncmp(driver->model, d->model, strlen(d->model))) ||
#  250|-> 			((d->revision != NULL) && strncmp(driver->revision, d->revision, strlen(d->revision))))
#  251|   			continue;
#  252|   

Error: CLANG_WARNING: [#def12]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:345:4: warning[deadcode.DeadStores]: Although the value stored to 'tmp' is used in the enclosing expression, the value is never actually read from 'tmp'
#  343|   
#  344|   	if(!pdrive->proto.get_drive_status ||
#  345|-> 		(tmp = pdrive->proto.get_drive_status(pdrive, pdrive->oldmode, &mode,
#  346|   		&pdrive->thiscd.cur_frame,
#  347|   		&pdrive->thiscd.curtrack,

Error: COMPILER_WARNING (CWE-563): [#def13]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c: scope_hint: In function ‘wm_cd_pause’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdrom.c:571:20: warning[-Wunused-but-set-variable]: variable ‘paused_pos’ set but not used
#  571 |         static int paused_pos;
#      |                    ^~~~~~~~~~
#  569|   {
#  570|   	struct wm_drive *pdrive = (struct wm_drive *)p;
#  571|-> 	static int paused_pos;
#  572|   	int status;
#  573|   

Error: CPPCHECK_WARNING: [#def14]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-563): [#def15]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c: scope_hint: In function ‘get_data_from_cdtext_pack’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c:159:7: warning[-Wunused-but-set-variable]: variable ‘language_block’ set but not used
#  159 |   int language_block;
#      |       ^~~~~~~~~~~~~~
#  157|     int arr = pack->header_field_id2_tracknumber;
#  158|     int i;
#  159|->   int language_block;
#  160|     int unicode;
#  161|   

Error: CLANG_WARNING: [#def16]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c:162:3: warning[deadcode.DeadStores]: Value stored to 'language_block' is never read
#  160|     int unicode;
#  161|   
#  162|->   language_block = (pack->header_field_id4_block_no >> 4) & 0x07;
#  163|     unicode = pack->header_field_id4_block_no & 0x80;
#  164|   

Error: COMPILER_WARNING (CWE-563): [#def17]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c: scope_hint: In function ‘get_glob_cdtext’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c:221:42: warning[-Wunused-but-set-variable]: variable ‘pack_previous’ set but not used
#  221 |   struct cdtext_pack_data_header *pack, *pack_previous;
#      |                                          ^~~~~~~~~~~~~
#  219|     int ret;
#  220|     int i;
#  221|->   struct cdtext_pack_data_header *pack, *pack_previous;
#  222|     cdtext_string *p_componente;
#  223|     struct cdtext_info_block *lp_block;

Error: CLANG_WARNING: [#def18]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/cdtext.c:250:7: warning[deadcode.DeadStores]: Value stored to 'pack_previous' is never read
#  248|       while(i < buffer_length)
#  249|       {
#  250|->       pack_previous = pack;
#  251|         pack = (struct cdtext_pack_data_header*)(buffer+i);
#  252|         /* to implement: check_crc(pack); */

Error: COMPILER_WARNING (CWE-563): [#def19]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/plat_linux.c: scope_hint: In function ‘gen_init’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/plat_linux.c:108:31: warning[-Wunused-parameter]: unused parameter ‘d’
#  108 | int gen_init(struct wm_drive *d)
#      |              ~~~~~~~~~~~~~~~~~^
#  106|    *
#  107|    *-------------------------------------------------------*/
#  108|-> int gen_init(struct wm_drive *d)
#  109|   {
#  110|   	return 0;

Error: COMPILER_WARNING (CWE-563): [#def20]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/plat_linux.c: scope_hint: In function ‘gen_cdda_init’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/plat_linux.c:638:36: warning[-Wunused-parameter]: unused parameter ‘d’
#  638 | int gen_cdda_init(struct wm_drive *d)
#      |                   ~~~~~~~~~~~~~~~~~^
#  636|   #endif
#  637|   
#  638|-> int gen_cdda_init(struct wm_drive *d)
#  639|   {
#  640|   	return 0;

Error: CPPCHECK_WARNING: [#def21]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING: [#def22]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c: scope_hint: In function ‘sendscsi’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c:123:24: warning[-Wimplicit-fallthrough=]: this statement may fall through
#  123 |                 cdblen = 12;
#      |                 ~~~~~~~^~~~
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c:125:9: note: here
#  125 |         case 1:
#      |         ^~~~
#  121|   		cdb[10] = a10;
#  122|   		cdb[11] = a11;
#  123|-> 		cdblen = 12;
#  124|   
#  125|   	case 1:

Error: CLANG_WARNING: [#def23]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c:189:18: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  187|   	pagebuf[0] = pagebuf[1] = pagebuf[2] = pagebuf[3] = 0;
#  188|   	for (i = 0; i < (int) len; i++)
#  189|-> 		pagebuf[i + 4] = buf[i];
#  190|   
#  191|   	return sendscsi(d, pagebuf, len + 4, 0, SCMD_MODE_SELECT, 0x10, 0,

Error: CLANG_WARNING: [#def24]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c:531:2: warning[deadcode.DeadStores]: Value stored to 'cdtext_possible' is never read
#  529|   
#  530|   	dynamic_temp = NULL;
#  531|-> 	cdtext_possible = 0;
#  532|   	wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "wm_scsi_get_cdtext entered\n");
#  533|   

Error: CLANG_WARNING: [#def25]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/scsi.c:557:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
#  555|   
#  556|   		memset(dynamic_temp, 0, feature_list_length);
#  557|-> 		ret = sendscsi(d, dynamic_temp, feature_list_length, 1,
#  558|   			0x46, 0x02, 0x00, 0x1E, 0, 0, 0, (feature_list_length>>8) & 0xFF,
#  559|   			feature_list_length & 0xFF, 0, 0, 0);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def26]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_libver_number’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:66:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘s’ where non-null expected
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_libver_number’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_libver_number’
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#   64|   	s = malloc(10);
#   65|   	/* this is not used very often, so don't care about speed...*/
#   66|-> 	sprintf(s, "%d.%d.%d", wm_libver_major(), wm_libver_minor(), wm_libver_pl());
#   67|   	return s;
#   68|   } /* wm_libver_number() */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def27]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcpy’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:123:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘s’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcpy’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcpy’
#  121|   
#  122|   	wm_lib_message(WM_MSG_CLASS_MISC | WM_MSG_LEVEL_DEBUG, "wm_strmcpy finally copying (%p, '%s')\n", *t, s);
#  123|-> 	strncpy(*t, s, strlen(s));
#  124|   } /* wm_strmcpy() */
#  125|   

Error: COMPILER_WARNING: [#def28]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcpy’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:123:9: warning[-Wstringop-truncation]: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length
#  123 |         strncpy(*t, s, strlen(s));
#      |         ^
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:123:9: note: length computed here
#  123 |         strncpy(*t, s, strlen(s));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
#  121|   
#  122|   	wm_lib_message(WM_MSG_CLASS_MISC | WM_MSG_LEVEL_DEBUG, "wm_strmcpy finally copying (%p, '%s')\n", *t, s);
#  123|-> 	strncpy(*t, s, strlen(s));
#  124|   } /* wm_strmcpy() */
#  125|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:140:20: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
#  138|   	{
#  139|   		len += strlen(*t);
#  140|-> 		*t = realloc(*t, len);
#  141|   		if (*t == NULL)
#  142|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:204:31: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
#  202|   	unsigned int l, c, vl, vc;
#  203|   	/* verbosity level */
#  204|-> 	vl = wm_lib_verbosity & WM_MSG_LEVEL_ALL;
#  205|   	/* allowed classes */
#  206|   	vc = wm_lib_verbosity & WM_MSG_CLASS_ALL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c:204:31: warning[-Wanalyzer-malloc-leak]: leak of ‘wm_libver_number()’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
libkcompactdisc-24.05.0-build/libkcompactdisc-24.05.0/src/wmlib/wm_helpers.c: scope_hint: In function ‘wm_strmcat’
#  202|   	unsigned int l, c, vl, vc;
#  203|   	/* verbosity level */
#  204|-> 	vl = wm_lib_verbosity & WM_MSG_LEVEL_ALL;
#  205|   	/* allowed classes */
#  206|   	vc = wm_lib_verbosity & WM_MSG_CLASS_ALL;

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-13.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibkcompactdisc-24.05.0-1.fc41
store-results-to/tmp/tmplm3mjk5u/libkcompactdisc-24.05.0-1.fc41.tar.xz
time-created2024-07-03 14:49:44
time-finished2024-07-03 14:50:57
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmplm3mjk5u/libkcompactdisc-24.05.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmplm3mjk5u/libkcompactdisc-24.05.0-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9