From d5bc100eab6238b4b682a45fc04e829ff46459ef Mon Sep 17 00:00:00 2001 From: Jonathan Hedley Date: Mon, 18 Dec 2023 09:20:40 +1100 Subject: [PATCH] Corrected namespace tests --- .../java/org/jsoup/parser/HtmlTreeBuilder.java | 4 ++-- src/test/resources/fuzztests/65147.html.gz | Bin 0 -> 315 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/fuzztests/65147.html.gz diff --git a/src/main/java/org/jsoup/parser/HtmlTreeBuilder.java b/src/main/java/org/jsoup/parser/HtmlTreeBuilder.java index 56b6289ee1..6e4d39e1b3 100644 --- a/src/main/java/org/jsoup/parser/HtmlTreeBuilder.java +++ b/src/main/java/org/jsoup/parser/HtmlTreeBuilder.java @@ -464,7 +464,7 @@ Element getFromStack(String elName) { final int upper = bottom >= maxQueueDepth ? bottom - maxQueueDepth : 0; for (int pos = bottom; pos >= upper; pos--) { Element next = stack.get(pos); - if (next.elementIs(elName, next.tag().namespace())) { + if (next.elementIs(elName, NamespaceHtml)) { return next; } } @@ -488,7 +488,7 @@ boolean removeFromStack(Element el) { Element popStackToClose(String elName) { for (int pos = stack.size() -1; pos >= 0; pos--) { Element el = pop(); - if (el.elementIs(elName, el.tag().namespace())) { + if (el.elementIs(elName, NamespaceHtml)) { return el; } } diff --git a/src/test/resources/fuzztests/65147.html.gz b/src/test/resources/fuzztests/65147.html.gz new file mode 100644 index 0000000000000000000000000000000000000000..4e1edd0e8bd94082d55914e099f39ce9945bb151 GIT binary patch literal 315 zcmV-B0mS|viwFo>a(`t212#1=G&e42bZu+^?Nq@|!!Qi}0{(yxfCDPKqNhkZ^uV1T zXjQXJO0tr;WBe3XxbPEv5oycEC(&UH{WJ1Ai zbjrxXW&%D6L$YHms9}VKltyeVTvi&K)IpDN#bY`W^;0yZ<`@k$4|NqKG;C44^icF2 z#MZS_!ZbL)fO8t0zc)B7{Hl#Ntd>K(zBao;){)!yt5BRm>UqOGnIpNnG|&;ty!kNa z2qbIeDP8`8cS~{c{<=N8v;bA{S~`B(kB2?<$EC9$THhVJ05o!xr{4bG-hSnp_E%`r N`2m$vuAZd|006^^mni@M literal 0 HcmV?d00001