Fix for potential oob write and missing boundary check am: 3aa73c4667 am: fcb341cd5e am: a44276bbf9 am: d33c74f211

Original change: https://android-review.googlesource.com/c/platform/hardware/nxp/secure_element/+/2628735

Change-Id: I90841b185df36cf4c8469a5512d59ae17a03b8c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>