| 2410 | } |
| 2411 | |
| 2412 | static void |
| 2413 | xmlPopPE(xmlParserCtxtPtr ctxt) { |
| 2414 | unsigned long consumed; |
| 2415 | xmlEntityPtr ent; |
| 2416 | |
| 2417 | ent = ctxt->input->entity; |
| 2418 | |
| 2419 | ent->flags &= ~XML_ENT_EXPANDING; |
| 2420 | |
| 2421 | if ((ent->flags & XML_ENT_CHECKED) == 0) { |
| 2422 | int result; |
| 2423 | |
| 2424 | /* |
| 2425 | * Read the rest of the stream in case of errors. We want |
| 2426 | * to account for the whole entity size. |
| 2427 | */ |
| 2428 | do { |
| 2429 | ctxt->input->cur = ctxt->input->end; |
| 2430 | xmlParserShrink(ctxt); |
| 2431 | result = xmlParserGrow(ctxt); |
| 2432 | } while (result > 0); |
| 2433 | |
| 2434 | consumed = ctxt->input->consumed; |
| 2435 | xmlSaturatedAddSizeT(&consumed, |
| 2436 | ctxt->input->end - ctxt->input->base); |
| 2437 | |
| 2438 | xmlSaturatedAdd(&ent->expandedSize, consumed); |
| 2439 | |
| 2440 | /* |
| 2441 | * Add to sizeentities when parsing an external entity |
| 2442 | * for the first time. |
| 2443 | */ |
| 2444 | if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) { |
| 2445 | xmlSaturatedAdd(&ctxt->sizeentities, consumed); |
| 2446 | } |
| 2447 | |
| 2448 | ent->flags |= XML_ENT_CHECKED; |
| 2449 | } |
| 2450 | |
| 2451 | xmlPopInput(ctxt); |
| 2452 | |
| 2453 | xmlParserEntityCheck(ctxt, ent->expandedSize); |
| 2454 | } |
| 2455 | |
| 2456 | /** |
| 2457 | * xmlSkipBlankCharsPE: |
no test coverage detected