chromium-issue-708434.patch 623 B

12345678910111213141516171819
  1. diff --git a/third_party/libxml/src/parserInternals.c b/third_party/libxml/src/parserInternals.c
  2. index bfc778ac1f77..286fdcea9760 100644
  3. --- src/parserInternals.c
  4. +++ src/parserInternals.c
  5. @@ -1369,8 +1369,13 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) {
  6. * should not happen while parsing which is the situation where
  7. * the id is actually needed.
  8. */
  9. - if (ctxt != NULL)
  10. + if (ctxt != NULL) {
  11. + if (ctxt->input_id >= INT_MAX) {
  12. + xmlErrMemory(ctxt, "Input ID overflow\n");
  13. + return(NULL);
  14. + }
  15. input->id = ctxt->input_id++;
  16. + }
  17. return(input);
  18. }