fix(ww3d2): Copy string setter inputs before freeing potentially aliased storage - #3313
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughChangesString replacement ordering
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The string replacement changes preserve aliased inputs without introducing an identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
Fix several string setters that freed the owned buffer before copying the new value, which is unsafe when the input aliases the current storage (e.g. self-assignment / overlapping pointers).
Duplicate first, then free, in
AggregateDefClass::Set_Name,ParameterClass::Set_Name,ParticleEmitterClass::Set_Name, andParticleEmitterDefClass::Set_Name/Set_User_String.Found by clang-tidy