Skip to content

Commit edb10f3

Browse files
jpnurmiclaude
andauthored
fix(value): use-after-free in object merge (#1539)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0142e4 commit edb10f3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Fixes**:
6+
7+
- Fix use-after-free on allocation failure when merging scope tags, extra, and contexts into a captured event. ([#1539](https://github.com/getsentry/sentry-native/pull/1539))
8+
39
## 0.13.0
410

511
**Breaking**:

src/sentry_value.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,10 +1112,10 @@ sentry__value_merge_objects(sentry_value_t dst, sentry_value_t src)
11121112
return 1;
11131113
}
11141114
} else if (sentry_value_is_null(dst_val)) {
1115+
sentry_value_incref(src_val);
11151116
if (sentry_value_set_by_key(dst, key, src_val) != 0) {
11161117
return 1;
11171118
}
1118-
sentry_value_incref(src_val);
11191119
}
11201120
}
11211121
return 0;

0 commit comments

Comments
 (0)