Merge "Fail explicitly on length overflow." into oc-dev am: ea8d38e77f am: cf91151364 am: 84dcff4c6b

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619803

Change-Id: Ie7b7a57f55ead23f8d382ac98eb5087a2c614b1b