From b14eb2a26c3fcbaa9d95edb569692baa0283c4ca Mon Sep 17 00:00:00 2001 From: Jonathan Hedley Date: Tue, 28 Sep 2021 09:21:45 +1000 Subject: [PATCH] Test case and change note for parser improvements incl tag flyweight Fixes #1646 --- CHANGES | 5 +++-- src/test/resources/fuzztests/1646.html.gz | Bin 0 -> 13460 bytes 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/fuzztests/1646.html.gz diff --git a/CHANGES b/CHANGES index 13f0353171..be9fc196ce 100644 --- a/CHANGES +++ b/CHANGES @@ -28,8 +28,9 @@ jsoup changelog * Improvement: when parsing custom tags (in HTML or XML), added a flyweight cache on Tag.valueOf(name) to reduce - memory overhead when many tags are repeated. - + memory overhead when many tags are repeated. Also tuned other areas of the parser when many very deeply stacked + custom elements were present. + * Bugfix: when tracking errors or checking for validity in the Cleaner, errors were incorrectly raised for missing optional closing tags. diff --git a/src/test/resources/fuzztests/1646.html.gz b/src/test/resources/fuzztests/1646.html.gz new file mode 100644 index 0000000000000000000000000000000000000000..ce142618a72fd041d9a5ef34e24210864c2abfff GIT binary patch literal 13460 zcmeHuc|4T+`@WDUq0}*wP$ZG1tXYOS=TwMN$~J~3m-2_xmod&p)1-d1juO=YGHM>%Ok*zDY&!^XqdR zcH~;MOGiyhRr#dfX-}@Dt*$l7v!x!OqwK5XdMZajazfL$9t=-9cYd67yz+gZ&H1DE*DZENT2V9hugBtC)x(pysVmA3U2Bh zysx(5f!cq*)lbs8jBJ{ zEqL!lg5jjo1c=W#Y-=3Wq9#2+-PlA!yOcg16?yzlD`Pd)9~^x8Jl&dnba=Z)?DpSApG%-FWdK`Cn< zj%^4(>*4QZO1i-XDvXJ#bx?STLH+okYUG|AjU8ft7v9!RR;OA>;*1FSxe?bgUJ*m! zPp!OS+-<~aINQe1wE8p<)+Yx_}X(6?ZsWRyAuYLO4DuVroo)_z#>uu-R@P5m+# zQb6FNITts-eO)CCxn|d2J4efEBd^Pab0K}Wu z<;d7`%y}S6x*Mum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