Skip to content

Comments

fix: remove spurious decref in sentry_capture_user_feedback()#1510

Merged
jpnurmi merged 1 commit intomasterfrom
jpnurmi/fix/user-report-decref
Feb 11, 2026
Merged

fix: remove spurious decref in sentry_capture_user_feedback()#1510
jpnurmi merged 1 commit intomasterfrom
jpnurmi/fix/user-report-decref

Conversation

@jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented Feb 10, 2026

Removes sentry_value_decref(user_report) from prepare_user_report() fail path. sentry_capture_user_feedback() already decrefs unconditionally, so having it in both places caused a use-after-free on failure.

The newer variant sentry_capture_feedback() had a similar issue, which was found by @tustanivsky in #1414 (comment). Notice the difference that sentry__envelope_add_user_feedback() takes ownership of the value, but sentry__envelope_add_user_report() does not (it only serializes it).

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Remove `sentry_value_decref(user_report)` from `prepare_user_report()`
fail path. The caller already decrefs unconditionally, so having it in
both places caused a use-after-free on failure.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@jpnurmi jpnurmi force-pushed the jpnurmi/fix/user-report-decref branch from 7927d69 to af3aaed Compare February 10, 2026 13:17
@jpnurmi jpnurmi changed the title fix: remove spurious decref in sentry_capture_user_feedback() fix: remove spurious decref in sentry_capture_user_report() Feb 10, 2026
@jpnurmi jpnurmi changed the title fix: remove spurious decref in sentry_capture_user_report() fix: remove spurious decref in sentry_capture_user_feedback() Feb 10, 2026
@jpnurmi jpnurmi requested a review from tustanivsky February 10, 2026 14:00
@jpnurmi jpnurmi merged commit f65919e into master Feb 11, 2026
55 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/fix/user-report-decref branch February 11, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants