Page MenuHome

Fix T81340: UBSan: applying offset to null pointer
AbandonedPublic

Authored by Ankit Meel (ankitm) on Oct 1 2020, 1:18 AM.

Details

Summary

olddata is const char *, so changing it and not using it afterwards
is not useful anyway.

The warning:
dna_genfile.c:990:13: runtime error: applying non-zero offset 8 to
null pointer

Fix T81340 (partially)

Diff Detail

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

Event Timeline

Ankit Meel (ankitm) requested review of this revision.Oct 1 2020, 1:18 AM
Ankit Meel (ankitm) created this revision.

Note that this is a harmless warning, and if this wasn't simple to solve I think it could be suppressed/ignored.

This patch breaks file loading: lib/tests/compositing/composite_materialindex.blend (for example), crashes as olddata needed to be incremented.


Committed alternate cleanup: rBc1ae12bf5e3d: Cleanup: dna_genfile API for accessing struct member offsets

This changes the API to return an offset instead of a pointer which sometimes starts off NULL.

Oh sorry. I was completely oblivious to the existence of the for loop.

.. not using it afterwards ..

This is so wrong.