Prevent integer overflow in copyString

The copyString function is only used for encoding string supplied by
the library user.
This commit is contained in:
Samanta Navarro 2022-02-15 11:56:57 +00:00
parent 81b89678e2
commit efcb347440

View file

@ -7412,7 +7412,7 @@ getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr,
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 */