Merge "Add isSafeArraySize for new array size checks" into lmp-dev