Hopefully solves these security issues from T52924:
CVE-2017-12081
CVE-2017-12082
CVE-2017-12086
CVE-2017-12099
CVE-2017-12100
CVE-2017-12101
CVE-2017-12102
CVE-2017-12103
CVE-2017-12104
CVE-2017-12105
I only checked code superficially though, and did not verify because the
repro files do not appear to be publicly available.
It works by adding MEM_malloc_arrayN() and MEM_calloc_arrayN() functions that
return NULL on integer overflow. These functions were only used in some
files around the reported vulnerabilities, not all over Blender, not sure
if we should try to use them everywhere. There is also no realloc, mapalloc
or aligned array function yet.