diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-17 22:38:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-17 22:38:30 +0300 |
commit | 8934f00ac5701ea349f2bcccab32e252c79aa730 (patch) | |
tree | ba4a990efea94c619d9d7ba68aff528992cafe3b /intern/ghost/intern/GHOST_SystemWin32.cpp | |
parent | 6069cab442045775262691929e85b9c1fb3874dc (diff) |
Attributes: Validate some builtin attributes for untrusted inputs
We expect some builtin attributes to have positive values or values
within a certain range, but currently there some cases where users
can set attributes to arbitrary values: the store named attribute node,
and the output attributes of the geometry nodes modifier. The set
material index node also needs validation.
This patch adds an `AttributeValidator` to the attribute API, which
can be used to correct values from these untrusted inputs if necessary.
As an alternative to D15548, this approach makes it much easier to
understand when validation is being applied, without the need to add
arguments to every attribute API method or complicate the virtual
array system.
Currently validation is provided with a multi-function. That integrates
well with the field evaluations that set these values now, but it could
be wrapped to be friendlier to other areas of Blender in the future.
The Python API is not handled here either. Currently I would prefer to
wait until we can integrate the C++ and C attribute APIs better before
addressing that.
Fixes T100952
Differential Revision: https://developer.blender.org/D15990
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.cpp')
0 files changed, 0 insertions, 0 deletions