• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From efcb347440ade24b9f1054671e6bd05e60b4cafd Mon Sep 17 00:00:00 2001
2From: Samanta Navarro <ferivoz@riseup.net>
3Date: Tue, 15 Feb 2022 11:56:57 +0000
4Subject: [PATCH] Prevent integer overflow in copyString
5
6The copyString function is only used for encoding string supplied by
7the library user.
8---
9 lib/xmlparse.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/lib/xmlparse.c b/lib/xmlparse.c
13index 4b43e613..a39377c2 100644
14--- a/lib/xmlparse.c
15+++ b/lib/xmlparse.c
16@@ -7412,7 +7412,7 @@ getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr,
17
18 static XML_Char *
19 copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
20-  int charsRequired = 0;
21+  size_t charsRequired = 0;
22   XML_Char *result;
23
24   /* First determine how long the string is */
25