* xmlPushInput: * @ctxt: an XML parser context * @input: an XML parser input fragment (entity, XML fragment ...). * * Push an input stream onto the stack. * * Returns -1 in case of error or the index in the input stack */
| 2555 | * Returns -1 in case of error or the index in the input stack |
| 2556 | */ |
| 2557 | int |
| 2558 | xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) { |
| 2559 | int maxDepth; |
| 2560 | int ret; |
| 2561 | |
| 2562 | if ((ctxt == NULL) || (input == NULL)) |
| 2563 | return(-1); |
| 2564 | |
| 2565 | maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20; |
| 2566 | if (ctxt->inputNr > maxDepth) { |
| 2567 | xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, |
| 2568 | "Maximum entity nesting depth exceeded"); |
| 2569 | xmlHaltParser(ctxt); |
| 2570 | return(-1); |
| 2571 | } |
| 2572 | ret = inputPush(ctxt, input); |
| 2573 | GROW; |
| 2574 | return(ret); |
| 2575 | } |
| 2576 | |
| 2577 | /** |
| 2578 | * xmlParseCharRef: |
no test coverage detected