Merge tag 'android-13.0.0_r52' into int/13/fp3
Android 13.0.0 Release 52 (TQ3A.230605.012)
* tag 'android-13.0.0_r52':
parser: Fix OOB read when formatting error message
Change-Id: I5d116ea4281fb8f82de3e16fc9f5072c05a7876e
diff --git a/parser.c b/parser.c
index 506c78a..f11f017 100644
--- a/parser.c
+++ b/parser.c
@@ -12170,7 +12170,11 @@
#endif
return(ret);
encoding_error:
- {
+ if (ctxt->input->end - ctxt->input->cur < 4) {
+ __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
+ "Input is not proper UTF-8, indicate encoding !\n",
+ NULL, NULL);
+ } else {
char buffer[150];
snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",