Prevent integer overflow in copyString

Bug: http://b/221384482
Change-Id: Ibdcb5dc24ee8886a04c2e29bd6ddccf29ece73ad
(cherry picked from commit fe3486a743af350becbed5cf10a56195a4a8756f)
Merged-In: Ibdcb5dc24ee8886a04c2e29bd6ddccf29ece73ad
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
index f598936..02bcfaa 100644
--- a/lib/xmlparse.c
+++ b/lib/xmlparse.c
@@ -6894,7 +6894,7 @@
 
 static XML_Char *
 copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
-  int charsRequired = 0;
+  size_t charsRequired = 0;
   XML_Char *result;
 
   /* First determine how long the string is */