Merge "msm: Fix out of bounds memory access and null pointer checks" into msm-3.0