CVE-2023-4154 replace: add ARRAY_INSERT_ELEMENT() helper