Merge pull request from GHSA-5x45-qp78-g4p4

* Prevent infinite loop in scanning xml content

* Simplify scanning method

* Optimization
This commit is contained in:
Riza Sulistyo 2022-03-29 13:59:03 +07:00 committed by GitHub
parent 38c13afa1c
commit 856f87c2e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -150,6 +150,8 @@ static pj_xml_node *xml_parse_node( pj_pool_t *pool, pj_scanner *scanner)
pj_scan_get_until_ch(scanner, ']', &node->content);
while (pj_scan_strcmp(scanner, "]]>", 3)) {
pj_str_t dummy;
pj_scan_advance_n(scanner, 1, PJ_FALSE);
pj_scan_get_until_ch(scanner, ']', &dummy);
}
node->content.slen = scanner->curptr - node->content.ptr;