Newly introduced findings

List of Findings

Error: CPPCHECK_WARNING (CWE-190): [#def1]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2589: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2587|   		spa_log_debug(state->log, "%p: snd_pcm_start linked:%u", state, state->linked);
# 2588|   		if (!state->linked && (res = snd_pcm_start(state->hndl)) < 0) {
# 2589|-> 			spa_log_error(state->log, "%s: snd_pcm_start: %s",
# 2590|   					state->name, snd_strerror(res));
# 2591|   			return res;

Error: CPPCHECK_WARNING (CWE-190): [#def2]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2608: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2606|   	snd_pcm_status_alloca(&status);
# 2607|   	if (SPA_UNLIKELY((res = snd_pcm_status(state->hndl, status)) < 0)) {
# 2608|-> 		spa_log_error(state->log, "%s: snd_pcm_status error: %s",
# 2609|   				state->name, snd_strerror(res));
# 2610|   		goto recover;

Error: CPPCHECK_WARNING (CWE-190): [#def3]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2628: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2626|   		missing += state->start_delay + state->threshold + state->headroom;
# 2627|   
# 2628|-> 		spa_log_trace(state->log, "%p: xrun of %"PRIu64" usec %"PRIu64,
# 2629|   				state, delay, missing);
# 2630|   

Error: CPPCHECK_WARNING (CWE-190): [#def4]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2640: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2638|   	}
# 2639|   	case SND_PCM_STATE_SUSPENDED:
# 2640|-> 		spa_log_info(state->log, "%s: recover from state %s",
# 2641|   				state->name, snd_pcm_state_name(st));
# 2642|   		while (retry++ < 5 && (res = snd_pcm_resume(state->hndl)) == -EAGAIN)

Error: CPPCHECK_WARNING (CWE-190): [#def5]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2650: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2648|   		break;
# 2649|   	default:
# 2650|-> 		spa_log_error(state->log, "%s: recover from error state %s",
# 2651|   				state->name, snd_pcm_state_name(st));
# 2652|   		break;

Error: CPPCHECK_WARNING (CWE-190): [#def6]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2701: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2699|   		if ((avail = alsa_avail(state)) < 0) {
# 2700|   			if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
# 2701|-> 				spa_log_warn(state->log, "%s: (%d suppressed) snd_pcm_avail after recover: %s",
# 2702|   						state->name, suppressed, snd_strerror(avail));
# 2703|   			}

Error: CPPCHECK_WARNING (CWE-190): [#def7]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2716: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2714|   		if ((res = snd_pcm_htimestamp(state->hndl, &havail, &tstamp)) < 0) {
# 2715|   			if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
# 2716|-> 				spa_log_warn(state->log, "%s: (%d suppressed) snd_pcm_htimestamp error: %s",
# 2717|   					state->name, suppressed, snd_strerror(res));
# 2718|   			}

Error: CPPCHECK_WARNING (CWE-190): [#def8]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2738: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2736|   			} else if (state->htimestamp_max_errors) {
# 2737|   				if (++state->htimestamp_error > state->htimestamp_max_errors) {
# 2738|-> 					spa_log_error(state->log, "%s: wrong htimestamps from driver, disabling",
# 2739|   						state->name);
# 2740|   					state->htimestamp_error = 0;

Error: CPPCHECK_WARNING (CWE-190): [#def9]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2744: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2742|   				}
# 2743|   				else if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
# 2744|-> 					spa_log_warn(state->log, "%s: (%d suppressed) impossible htimestamp diff:%"PRIi64,
# 2745|   						state->name, suppressed, diff);
# 2746|   				}

Error: CPPCHECK_WARNING (CWE-190): [#def10]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2809: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2807|   	if (SPA_UNLIKELY(diff != 0)) {
# 2808|   		err -= diff;
# 2809|-> 		spa_log_trace(state->log, "%p: follower:%d quantum change %d -> %d (%d) %f",
# 2810|   				state, follower, state->last_threshold, state->threshold, diff, err);
# 2811|   		state->last_threshold = state->threshold;

Error: CPPCHECK_WARNING (CWE-190): [#def11]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2846: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2844|   		bw = (fabs(state->err_avg) + sqrt(fabs(state->err_var)))/1000.0;
# 2845|   
# 2846|-> 		spa_log_debug(state->log, "%s: follower:%d match:%d rate:%f "
# 2847|   				"bw:%f thr:%u del:%ld target:%ld err:%f max_err:%f max_resync: %f var:%f:%f:%f",
# 2848|   				state->name, follower, state->matching,

Error: CPPCHECK_WARNING (CWE-190): [#def12]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2895: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2893|   		return -ENOTSUP;
# 2894|   
# 2895|-> 	spa_log_debug(state->log, "driver clock:'%s' our clock:'%s'",
# 2896|   			state->position->clock.name, state->clock_name);
# 2897|   

Error: CPPCHECK_WARNING (CWE-190): [#def13]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2905: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2903|   	recalc_headroom(state);
# 2904|   
# 2905|-> 	spa_log_info(state->log, "driver clock:'%s'@%d our clock:'%s'@%d matching:%d resample:%d",
# 2906|   			state->position->clock.name, state->driver_rate.denom,
# 2907|   			state->clock_name, state->rate,

Error: CPPCHECK_WARNING (CWE-190): [#def14]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2950: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2948|   	if (SPA_UNLIKELY((state->driver_duration != target_duration) ||
# 2949|   	    (state->driver_rate.denom != target_rate.denom))) {
# 2950|-> 		spa_log_info(state->log, "%p: follower:%d duration:%u->%"PRIu64" rate:%d->%d",
# 2951|   				state, state->following, state->driver_duration, target_duration,
# 2952|   				state->driver_rate.denom, target_rate.denom);

Error: CPPCHECK_WARNING (CWE-190): [#def15]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2977: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2975|   
# 2976|   	if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0)) {
# 2977|-> 		spa_log_error(state->log, "get_status error: %s", spa_strerror(res));
# 2978|   		state->next_time += (uint64_t)(state->threshold * 1e9 / state->rate);
# 2979|   		return res;

Error: CPPCHECK_WARNING (CWE-190): [#def16]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:2983: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 2981|   
# 2982|   	if (SPA_UNLIKELY(!following && state->alsa_started && delay > target + state->max_error)) {
# 2983|-> 		spa_log_trace(state->log, "%p: early wakeup %ld %lu %lu", state,
# 2984|   				avail, delay, target);
# 2985|   		if (delay > target * 3)

Error: CPPCHECK_WARNING (CWE-190): [#def17]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3005: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3003|   				lev = SPA_LOG_LEVEL_DEBUG;
# 3004|   
# 3005|-> 			spa_log_lev(state->log, lev, "%s: follower avail:%lu delay:%ld "
# 3006|   					"target:%ld thr:%u, resync (%d suppressed)",
# 3007|   					state->name, avail, delay,

Error: CPPCHECK_WARNING (CWE-190): [#def18]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3037: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3035|   	if (state->use_mmap && frames > 0) {
# 3036|   		if (SPA_UNLIKELY((res = snd_pcm_mmap_begin(hndl, &my_areas, &offset, &frames)) < 0)) {
# 3037|-> 			spa_log_error(state->log, "%s: snd_pcm_mmap_begin error: %s",
# 3038|   					state->name, snd_strerror(res));
# 3039|   			alsa_recover(state);

Error: CPPCHECK_WARNING (CWE-190): [#def19]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3111: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3109|   		if (SPA_UNLIKELY((commitres = snd_pcm_mmap_commit(hndl, offset, written)) < 0)) {
# 3110|   			if (commitres == -EPIPE || commitres == -ESTRPIPE) {
# 3111|-> 				spa_log_warn(state->log, "%s: snd_pcm_mmap_commit error: %s",
# 3112|   						state->name, snd_strerror(commitres));
# 3113|   			} else {

Error: CPPCHECK_WARNING (CWE-190): [#def20]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3114: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3112|   						state->name, snd_strerror(commitres));
# 3113|   			} else {
# 3114|-> 				spa_log_error(state->log, "%s: snd_pcm_mmap_commit error: %s",
# 3115|   						state->name, snd_strerror(commitres));
# 3116|   				return res;

Error: CPPCHECK_WARNING (CWE-190): [#def21]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3120: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3118|   		}
# 3119|   		if (commitres > 0 && written != (snd_pcm_uframes_t) commitres) {
# 3120|-> 			spa_log_warn(state->log, "%s: mmap_commit wrote %ld instead of %ld",
# 3121|   				     state->name, commitres, written);
# 3122|   		}

Error: CPPCHECK_WARNING (CWE-190): [#def22]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3167: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3165|   
# 3166|   	if (spa_list_is_empty(&state->free)) {
# 3167|-> 		spa_log_warn(state->log, "%s: no more buffers", state->name);
# 3168|   		total_frames = frames;
# 3169|   	} else {

Error: CPPCHECK_WARNING (CWE-190): [#def23]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3242: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3240|   
# 3241|   	if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0)) {
# 3242|-> 		spa_log_error(state->log, "get_status error: %s", spa_strerror(res));
# 3243|   		state->next_time += (uint64_t)(state->threshold * 1e9 / state->rate);
# 3244|   		return res;

Error: CPPCHECK_WARNING (CWE-190): [#def24]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3248: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3246|   
# 3247|   	if (SPA_UNLIKELY(!following && avail < state->read_size)) {
# 3248|-> 		spa_log_trace(state->log, "%p: early wakeup %ld %ld %ld %d", state,
# 3249|   				delay, avail, target, state->read_size);
# 3250|   		state->next_time = current_time + (state->read_size - avail) * SPA_NSEC_PER_SEC /

Error: CPPCHECK_WARNING (CWE-190): [#def25]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3271: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3269|   				lev = SPA_LOG_LEVEL_DEBUG;
# 3270|   
# 3271|-> 			spa_log_lev(state->log, lev, "%s: follower delay:%ld target:%ld thr:%u "
# 3272|   					"resample:%d, resync (%d suppressed)", state->name, delay,
# 3273|   					target, state->threshold, state->resample, suppressed);

Error: CPPCHECK_WARNING (CWE-190): [#def26]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3307: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3305|   		avail = state->buffer_frames;
# 3306|   		if ((res = snd_pcm_mmap_begin(hndl, &my_areas, &offset, &avail)) < 0) {
# 3307|-> 			spa_log_error(state->log, "%s: snd_pcm_mmap_begin error: %s",
# 3308|   					state->name, snd_strerror(res));
# 3309|   			alsa_recover(state);

Error: CPPCHECK_WARNING (CWE-190): [#def27]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3339: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3337|   				lev = SPA_LOG_LEVEL_INFO;
# 3338|   
# 3339|-> 			spa_log_lev(state->log, lev, "%s: snd_pcm_mmap_commit error %lu %lu %lu: %s",
# 3340|   					state->name, frames, avail, read, snd_strerror(commitres));
# 3341|   			if (commitres != -EPIPE && commitres != -ESTRPIPE)

Error: CPPCHECK_WARNING (CWE-190): [#def28]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3345: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3343|   		}
# 3344|   		if (commitres > 0 && read != (snd_pcm_uframes_t) commitres) {
# 3345|-> 			spa_log_warn(state->log, "%s: mmap_commit read %ld instead of %ld",
# 3346|   				     state->name, commitres, read);
# 3347|   		}

Error: CPPCHECK_WARNING (CWE-190): [#def29]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3371: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3369|   
# 3370|   	if (SPA_UNLIKELY(spa_list_is_empty(&state->free))) {
# 3371|-> 		spa_log_warn(state->log, "%s: no more buffers", state->name);
# 3372|   		return -EPIPE;
# 3373|   	}

Error: CPPCHECK_WARNING (CWE-190): [#def30]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3517: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3515|   	if (SPA_UNLIKELY(err = snd_pcm_poll_descriptors_revents(state->hndl,
# 3516|   					state->pfds, state->n_fds, &revents))) {
# 3517|-> 		spa_log_error(state->log, "Could not look up revents: %s",
# 3518|   				snd_strerror(err));
# 3519|   		return;

Error: CPPCHECK_WARNING (CWE-190): [#def31]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3547: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3545|   			 * in the same epoll wakeup cycle */
# 3546|   			if (res != -EAGAIN)
# 3547|-> 				spa_log_warn(state->log, "%p: error reading timerfd: %s",
# 3548|   						state, spa_strerror(res));
# 3549|   			return;

Error: CPPCHECK_WARNING (CWE-190): [#def32]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3559: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3557|   	    current_time > state->next_time + SPA_NSEC_PER_SEC) {
# 3558|   		if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
# 3559|-> 			spa_log_error(state->log, "%s: impossible timeout %"
# 3560|   				PRIu64" %"PRIu64" %"PRIi64" %d %"PRIi64" (%d suppressed)",
# 3561|   				state->name, current_time, state->next_time,

Error: CPPCHECK_WARNING (CWE-190): [#def33]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3607: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3605|   				spa_list_append(&state->driver->rt.followers, &rt->driver_link);
# 3606|   			rt->driver = state->driver;
# 3607|-> 			spa_log_debug(state->log, "state:%p -> driver:%p", state, state->driver);
# 3608|   
# 3609|   			if(state->linked && state->matching)

Error: CPPCHECK_WARNING (CWE-190): [#def34]
pipewire-1.4.2/spa/plugins/alsa/alsa-pcm.c:3646: error[integerOverflow]: Signed integer overflow for expression '0-1'.
# 3644|   
# 3645|   	if (check_position_config(state, true) < 0) {
# 3646|-> 		spa_log_error(state->log, "%s: invalid position config", state->name);
# 3647|   		return -EIO;
# 3648|   	}

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.86.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.0.1
diffbase-analyzer-version-gcc-analyzer15.0.1
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-67.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namepipewire-1.4.1-1.fc42
diffbase-store-results-to/tmp/tmpgr7qr5oy/pipewire-1.4.1-1.fc42.tar.xz
diffbase-time-created2025-04-25 14:49:40
diffbase-time-finished2025-04-25 15:04:46
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpgr7qr5oy/pipewire-1.4.1-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpgr7qr5oy/pipewire-1.4.1-1.fc42.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-67.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namepipewire-1.4.2-1.fc43
store-results-to/tmp/tmplb4d0ucm/pipewire-1.4.2-1.fc43.tar.xz
time-created2025-04-25 15:05:28
time-finished2025-04-25 15:20:09
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmplb4d0ucm/pipewire-1.4.2-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmplb4d0ucm/pipewire-1.4.2-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9