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

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

Change-Id: Idb480f2a4dc1aa0d929e17e7e568a9c1b05c8489