Merge "Prevent out-of-bounds read" into sc-dev