Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-190): [#def1]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-acp-device.c:1115: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 1113|   	acp_i18n = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_I18N);
# 1114|   	if (this->loop == NULL) {
# 1115|-> 		spa_log_error(this->log, "a Loop interface is needed");
# 1116|   		return -EINVAL;
# 1117|   	}

Error: CPPCHECK_WARNING (CWE-190): [#def2]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-acp-device.c:1143: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 1141|   	}
# 1142|   
# 1143|-> 	spa_log_debug(this->log, "probe card %s", this->props.device);
# 1144|   	if ((str = strchr(this->props.device, ':')) == NULL)
# 1145|   		return -EINVAL;

Error: CPPCHECK_WARNING (CWE-190): [#def3]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:178: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  176|   		goto next;
#  177|   
#  178|-> 	spa_node_emit_result(&this->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result);
#  179|   
#  180|   	if (++count != num)

Error: CPPCHECK_WARNING (CWE-190): [#def4]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:386: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  384|   	spa_return_val_if_fail(this != NULL, -EINVAL);
#  385|   
#  386|-> 	spa_node_emit_result(&this->hooks, seq, 0, 0, NULL);
#  387|   
#  388|   	return 0;

Error: CPPCHECK_WARNING (CWE-190): [#def5]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:546: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  544|   		goto next;
#  545|   
#  546|-> 	spa_node_emit_result(&this->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result);
#  547|   
#  548|   	if (++count != num)

Error: CPPCHECK_WARNING (CWE-190): [#def6]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:575: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  573|   			return 0;
#  574|   
#  575|-> 		spa_log_debug(this->log, "clear format");
#  576|   		spa_alsa_close(this);
#  577|   		clear_buffers(this);

Error: CPPCHECK_WARNING (CWE-190): [#def7]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:704: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  702|   	spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
#  703|   
#  704|-> 	spa_log_debug(this->log, "%p: use %d buffers", this, n_buffers);
#  705|   
#  706|   	if (this->n_buffers > 0) {

Error: CPPCHECK_WARNING (CWE-190): [#def8]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:727: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  725|   
#  726|   		if (d[0].data == NULL) {
#  727|-> 			spa_log_error(this->log, "%p: need mapped memory", this);
#  728|   			return -EINVAL;
#  729|   		}

Error: CPPCHECK_WARNING (CWE-190): [#def9]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:730: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  728|   			return -EINVAL;
#  729|   		}
#  730|-> 		spa_log_debug(this->log, "%p: %d %p data:%p", this, i, b->buf, d[0].data);
#  731|   	}
#  732|   	this->n_buffers = n_buffers;

Error: CPPCHECK_WARNING (CWE-190): [#def10]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:750: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  748|   	spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
#  749|   
#  750|-> 	spa_log_debug(this->log, "%p: io %d %p %zd", this, id, data, size);
#  751|   
#  752|   	switch (id) {

Error: CPPCHECK_WARNING (CWE-190): [#def11]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:793: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  791|   
#  792|   		if (!SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
#  793|-> 			spa_log_warn(this->log, "%p: buffer %u in use",
#  794|   					this, io->buffer_id);
#  795|   			io->status = -EINVAL;

Error: CPPCHECK_WARNING (CWE-190): [#def12]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:885: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  883|   
#  884|   	if (this->main_loop == NULL) {
#  885|-> 		spa_log_error(this->log, "a main loop is needed");
#  886|   		return -EINVAL;
#  887|   	}

Error: CPPCHECK_WARNING (CWE-190): [#def13]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:889: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  887|   	}
#  888|   	if (this->data_loop == NULL) {
#  889|-> 		spa_log_error(this->log, "a data loop is needed");
#  890|   		return -EINVAL;
#  891|   	}

Error: CPPCHECK_WARNING (CWE-190): [#def14]
pipewire-1.2.5-build/pipewire-1.2.5/spa/plugins/alsa/alsa-pcm-sink.c:893: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  891|   	}
#  892|   	if (this->data_system == NULL) {
#  893|-> 		spa_log_error(this->log, "a data system is needed");
#  894|   		return -EINVAL;
#  895|   	}

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
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-227.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namepipewire-1.2.6-1.fc42
diffbase-store-results-to/tmp/tmpuofmh28i/pipewire-1.2.6-1.fc42.tar.xz
diffbase-time-created2024-11-13 02:33:15
diffbase-time-finished2024-11-13 02:46:39
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpuofmh28i/pipewire-1.2.6-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpuofmh28i/pipewire-1.2.6-1.fc42.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-227.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namepipewire-1.2.5-1.fc41
store-results-to/tmp/tmpdezycrh7/pipewire-1.2.5-1.fc41.tar.xz
time-created2024-11-13 02:19:11
time-finished2024-11-13 02:32:51
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpdezycrh7/pipewire-1.2.5-1.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpdezycrh7/pipewire-1.2.5-1.fc41.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9