blender/doc/python_api/rst
Bastien Montagne c8a6c96db2 Core: Harden IDProps against too-high embedding depth.
IDProperties can be embedded into one-another with no theoritical depth
limit, however the code currently uses recursive patterns to process
them, which means beyond a certain depth it will run out of stack memory
and crash.

While we cannot really prevent creating such insanely high data depth,
this commit adds several safe-guards (readfile, writefile, foreach_id,
and freeing processes), skipping further processing beyond a certain
recursion depth (currently set at 1024, which should be both well
within safety margins of any modern OS, and more than enough for any
practical use-case).

Issue initially reported by Ray Molenkemp (@lazydodo), thanks.

This commit also contains a small refactor for the IDProperty freeing
code (and IDP array resize internal logic), essentially removing public
API to free IDProperties' content - all of its usages was immediately
after calling MEM_delete on the same root properties, so can as well
call directly IDP_FreeProperty.

Finally, it fixes a potential bug related to arrays of groups freeing,
where the 'do_id_user' option was not properly propagated through the
array resize logic. Probably not an issue in practice though (not sure
if arrays of groups are used anywhere currently?).

Pull Request: https://projects.blender.org/blender/blender/pulls/160274
2026-06-18 12:07:48 +02:00
..
change_log.rst
include__bmesh.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_advanced.rst
info_advanced_blender_as_bpy.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_api_reference.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_best_practice.rst Cleanup: long line & trailing space in recent commit to API docs 2026-05-13 12:24:11 +10:00
info_contributing.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_gotcha.rst
info_gotchas_armatures_and_bones.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_gotchas_crashes.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_gotchas_file_paths_and_encoding.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_gotchas_internal_data_and_python_objects.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00
info_gotchas_meshes.rst
info_gotchas_operators.rst PyDoc: correct operator links, use :func: instead of :mod: 2026-02-16 18:20:55 +11:00
info_gotchas_threading.rst Cleanup: long line & trailing space in recent commit to API docs 2026-05-13 12:24:11 +10:00
info_overview.rst Docs: update to reference extensions instead of "bl_info" 2026-05-19 07:49:29 +00:00
info_quickstart.rst Core: Harden IDProps against too-high embedding depth. 2026-06-18 12:07:48 +02:00
info_tips_and_tricks.rst PyDoc: corrections in manually maintained RST docs 2026-02-16 03:42:15 +00:00