Commit 8991876
committed
Guard span baggage inheritance against malformed parent zval
ddtrace_inherit_span_properties copies the parent span's baggage property
with ZVAL_COPY_DEREF, which runs GC_ADDREF unconditionally when the source
is flagged refcounted. When the parent baggage zval carries the refcounted
flag but a NULL counted pointer, GC_ADDREF dereferences NULL and the process
takes a SIGSEGV during span creation.
Skip the copy and fall back to the property's declared empty-array default
when the source zval is in that broken state. Valid baggage is unaffected.
Signed-off-by: Dani Jimenez <daniel.jimenez@airalo.com>1 parent cd4e9ba commit 8991876
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
| |||
733 | 741 | | |
734 | 742 | | |
735 | 743 | | |
736 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
737 | 751 | | |
738 | 752 | | |
739 | 753 | | |
| |||
0 commit comments