Page MenuHome

Fix: add attribute with empty string name crash
ClosedPublic

Authored by Ethan Hall (Ethan1080) on Apr 23 2022, 12:07 PM.

Details

Summary

Due to a recent change, empty strings are unhandled. This results
in Blender crashing.

This patch fixes the crash but a discrepancy still exists...
Prior to the regression, the empty string would be replaced by the
name of the data type. This patch uses "Attribute" for the default
name regardless of type. Restoring the previous behavior would
require making and/or modifying API methods.

Regression introduced in: rBeae36be372a6

Diff Detail

Repository
rB Blender
Branch
fix_name_crash (branched from master)
Build Status
Buildable 21759
Build 21759: arc lint + arc unit

Event Timeline

Ethan Hall (Ethan1080) requested review of this revision.Apr 23 2022, 12:07 PM
Ethan Hall (Ethan1080) created this revision.
Campbell Barton (campbellbarton) requested changes to this revision.Apr 26 2022, 9:55 AM
This revision now requires changes to proceed.Apr 26 2022, 9:55 AM
source/blender/blenkernel/intern/attribute.c
31

Is this needed?

176–181
  • Most uses of this function use DATA_ not IFACE_, if there is a good reason to be different here, it should be noted why.
  • Most uses of BLI_uniquename_cb take in the default name as an argument, as far as I can see this could be done here too.

Since the changes are small, setting as accepted since another iteration isn't needed.

This revision is now accepted and ready to land.Apr 26 2022, 10:01 AM
  • Remove unused include
Ethan Hall (Ethan1080) marked an inline comment as done.Apr 26 2022, 10:29 AM