Prevent integer overflow in copyString am: 5164ae7869 am: 79784ba29a am: 7eb453eafe

Original change: https://googleplex-android-review.googlesource.com/c/platform/external/expat/+/18590076

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