leptris 1.9.368.1-arm-linux → 1.9.370.0-arm-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +29 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/leptris/html/html_parse.c +19 -0
- data/vendor-src/libleptris/test/dom/test_dom.cpp +30 -0
- data/vendor-src/libleptris/test/html/test_html.cpp +64 -0
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb3178566aef2ede92ee5b3ec8c86bcf7796a3244b44a18c8d8acef5845ed7e3
|
|
4
|
+
data.tar.gz: 1c61c14ad5e51f8752ef62fbba1ad09a4791679dd346c2c870ed3db3f59f2ded
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ce637d4d2cc609945b0e025981a3b03fdc1c74cf49a90f4aa2c0dae9e8382fbd8c711af09429f73a03eb846c55ca510438f4f51dd1f6fcb74e6fe493d8dada4
|
|
7
|
+
data.tar.gz: 69f692711674f92f2ccd6888aecc73ff58a707495260cb6223bcba10aa3f52215ace08feea2ff2d562d2f64f62d557ce1a40b559450f6af676b9b53ed67e7999
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
|
8
8
|
# Pin for `rake compile` and the platform-gem builds. Keep in lockstep
|
|
9
9
|
# with .github/workflows/build.yml (which calls `rake compile`) and the
|
|
10
10
|
# CHANGELOG when libleptris releases.
|
|
11
|
-
LIBLEPTRIS_VERSION = "1.9.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.370"
|
|
12
12
|
# Vendored alongside libleptris for fn:normalize-unicode (TODO
|
|
13
13
|
# .restructure/20): built per platform with a RELOCATABLE @rpath
|
|
14
14
|
# install name, loaded by ffi.rb before libleptris so the
|
data/lib/leptris/version.rb
CHANGED
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.370] - 2026-10-18
|
|
4
|
+
|
|
5
|
+
<!-- Edit this section with the actual release notes. -->
|
|
6
|
+
<!-- See https://keepachangelog.com for format guidance. -->
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- (describe changes here)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [1.9.369] - 2026-10-18
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **test: falsifiable kind-safety pin for the #487 class (PR #1765).**
|
|
18
|
+
The #487 fix's original contract test passes on both sides of the fix
|
|
19
|
+
(a pool-created detached text survives the element-form misread), so
|
|
20
|
+
it could not catch a regression. `OversizedTextKindSafe` uses the
|
|
21
|
+
shape that actually crashed in the wild — HEAP-BACKED text (oversized
|
|
22
|
+
content leaves the inline-window allocation) — and asserts the
|
|
23
|
+
kind-safe contract end to end: get_document answers the text's own
|
|
24
|
+
owner document (the observable red on pre-fix source was NULL — the
|
|
25
|
+
same element-form misread that wild-pointer-walked under the
|
|
26
|
+
reporter's GC timing), and the oversized text attaches through the
|
|
27
|
+
addr face and round-trips byte-exactly. Falsifiability verified both
|
|
28
|
+
ways: RED on pre-fix source (deterministic NULL), GREEN on the
|
|
29
|
+
fixed source. Test-only.
|
|
30
|
+
|
|
31
|
+
|
|
3
32
|
## [1.9.368] - 2026-10-18
|
|
4
33
|
|
|
5
34
|
### Fixed
|
|
@@ -4890,6 +4890,14 @@ static void h_split_head_body(HBuilder* b, LeptrisElement html,
|
|
|
4890
4890
|
int hty = leptris_node_get_type(head_end);
|
|
4891
4891
|
if (hty == LEPTRIS_NODE_TYPE_COMMENT ||
|
|
4892
4892
|
hty == LEPTRIS_NODE_TYPE_PI) {
|
|
4893
|
+
/* leptris#389: once a structural <body> token has
|
|
4894
|
+
* opened the in-body window, a comment is BODY
|
|
4895
|
+
* content (13.2.6.4.4 inserts at the current node)
|
|
4896
|
+
* — end the head run here so the comment leads the
|
|
4897
|
+
* rest into the body, instead of joining the head
|
|
4898
|
+
* run or the after-head deferral. */
|
|
4899
|
+
if (b->body_tag_seen)
|
|
4900
|
+
break;
|
|
4893
4901
|
if (b->whatwg_head_set) {
|
|
4894
4902
|
if (past_head_end) {
|
|
4895
4903
|
/* After </head>: the comment is an html
|
|
@@ -5221,6 +5229,16 @@ head_end = leptris_node_get_next_sibling(head_end);
|
|
|
5221
5229
|
if (b->whatwg_head_set && !b->frameset &&
|
|
5222
5230
|
(rest || b->head_end_seen)) {
|
|
5223
5231
|
if (b->head_end_seen) {
|
|
5232
|
+
/* leptris#389: a structural <body> start tag opens the
|
|
5233
|
+
* in-body window — comments after it insert at the
|
|
5234
|
+
* current node (13.2.6.4.4 in-body comment insertion)
|
|
5235
|
+
* and belong INSIDE the body. The after-head front
|
|
5236
|
+
* peel (13.2.6.4.6) only governs the pre-body window;
|
|
5237
|
+
* once body_tag_seen armed the body, leading comments
|
|
5238
|
+
* of the rest stay body content. The head-commit and
|
|
5239
|
+
* after-body peel below stay unconditional. */
|
|
5240
|
+
int in_body_window = b->body_tag_seen;
|
|
5241
|
+
if (!in_body_window) {
|
|
5224
5242
|
/* Front peel: leading comments/PIs of the rest. Uses
|
|
5225
5243
|
* its OWN last-marker so the ws-registered suffix
|
|
5226
5244
|
* segment is MERGED (ws first, then comments), never
|
|
@@ -5254,6 +5272,7 @@ head_end = leptris_node_get_next_sibling(head_end);
|
|
|
5254
5272
|
suffix_first = peel_first;
|
|
5255
5273
|
suffix_last = peel_last;
|
|
5256
5274
|
}
|
|
5275
|
+
}
|
|
5257
5276
|
/* A comment tokenized BEFORE </html> but after
|
|
5258
5277
|
* </body> rides in the rest - peel the trailing run
|
|
5259
5278
|
* to the html level, exactly like the </body>-only
|
|
@@ -3078,6 +3078,36 @@ TEST(DomAttachInstalled, ForeignMixedChainTextBeforeElement) {
|
|
|
3078
3078
|
* usually survives the misread; a recycled or heap-backed text
|
|
3079
3079
|
* hands the walk a wild pointer and the process dies. The face (and
|
|
3080
3080
|
* get_document itself) must be kind-safe. */
|
|
3081
|
+
/* leptris-ruby#487, the falsifiable pin: the crashing texts in the
|
|
3082
|
+
* wild were HEAP-BACKED (oversized content leaves the inline window —
|
|
3083
|
+
* the pool-created text of TextChildAttachIsKindSafe survives the
|
|
3084
|
+
* element-form misread, so that test alone cannot go red). An
|
|
3085
|
+
* oversized text must resolve its document through its OWN owner
|
|
3086
|
+
* field, attach, and round-trip — never through element-form reads. */
|
|
3087
|
+
TEST(DomAttachInstalled, OversizedTextKindSafe) {
|
|
3088
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
3089
|
+
LeptrisDocument d = leptris_parse_string("<r/>", 4, &st);
|
|
3090
|
+
ASSERT_NE(d, nullptr);
|
|
3091
|
+
LeptrisElement root = leptris_document_root(d);
|
|
3092
|
+
|
|
3093
|
+
std::string big(8192, 'x');
|
|
3094
|
+
LeptrisNodeRef text = leptris_text_node_create(d, big.c_str());
|
|
3095
|
+
ASSERT_NE(text, nullptr);
|
|
3096
|
+
EXPECT_EQ(leptris_node_get_type(text), LEPTRIS_NODE_TYPE_TEXT);
|
|
3097
|
+
|
|
3098
|
+
/* kind-safe document resolution: the text's OWN owner doc */
|
|
3099
|
+
EXPECT_EQ(leptris_element_get_document((LeptrisElement)text), d);
|
|
3100
|
+
|
|
3101
|
+
EXPECT_EQ(leptris_element_add_child_addr_installed(
|
|
3102
|
+
(uintptr_t)root, (uintptr_t)text, NULL),
|
|
3103
|
+
LEPTRIS_OK);
|
|
3104
|
+
char* out = leptris_element_serialize(root, nullptr);
|
|
3105
|
+
ASSERT_NE(out, nullptr);
|
|
3106
|
+
EXPECT_EQ(std::string(out), "<r>" + big + "</r>");
|
|
3107
|
+
leptris_free_string(out);
|
|
3108
|
+
leptris_document_free(d);
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3081
3111
|
TEST(DomAttachInstalled, TextChildAttachIsKindSafe) {
|
|
3082
3112
|
LeptrisStatus st = LEPTRIS_OK;
|
|
3083
3113
|
LeptrisDocument d = leptris_parse_string("<r/>", 4, &st);
|
|
@@ -10,6 +10,10 @@ extern "C" {
|
|
|
10
10
|
#include <cstring>
|
|
11
11
|
#include <string>
|
|
12
12
|
|
|
13
|
+
static bool h389_ieq(const char* a, const char* b) {
|
|
14
|
+
return a && b && strcmp(a, b) == 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
namespace {
|
|
14
18
|
|
|
15
19
|
/* Tree-shape dumps force the XML method (ext.html_method = -1,
|
|
@@ -2270,3 +2274,63 @@ TEST(HtmlParse, SetTextSurvivesSerialization) {
|
|
|
2270
2274
|
leptris_document_free(doc);
|
|
2271
2275
|
}
|
|
2272
2276
|
}
|
|
2277
|
+
|
|
2278
|
+
/* leptris#389: a comment token following ignored <html>/<body>
|
|
2279
|
+
* start tags must insert at the current node (WHATWG 13.2.6.4.4
|
|
2280
|
+
* in-body comment insertion) — the ignored start tags do not
|
|
2281
|
+
* change where subsequent comments land, and the after-head
|
|
2282
|
+
* front-peel (13.2.6.4.6) does not govern the in-body window.
|
|
2283
|
+
* The structural <body> handler only stashes attributes; the
|
|
2284
|
+
* body materializes at the split, and the comment must ride the
|
|
2285
|
+
* rest INTO it — not peel to the html level (which orphaned it
|
|
2286
|
+
* when the split short-circuited on the explicit-body walk). */
|
|
2287
|
+
TEST(HtmlParse, InBodyCommentAfterIgnoredStructuralStartTags) {
|
|
2288
|
+
LeptrisStatus st;
|
|
2289
|
+
const char* doc1 =
|
|
2290
|
+
"<body><html><body><!-- c --><p>Test</p></body></html></body>";
|
|
2291
|
+
LeptrisDocument d = leptris_parse_html_string(doc1, strlen(doc1), &st);
|
|
2292
|
+
ASSERT_NE(d, nullptr);
|
|
2293
|
+
LeptrisElement body = nullptr;
|
|
2294
|
+
for (LeptrisNodeRef c = leptris_node_first_child(
|
|
2295
|
+
(LeptrisNodeRef)leptris_document_root(d));
|
|
2296
|
+
c; c = leptris_node_next_sibling((LeptrisNodeRef)c))
|
|
2297
|
+
if (leptris_node_get_type(c) == LEPTRIS_NODE_TYPE_ELEMENT &&
|
|
2298
|
+
h389_ieq(leptris_element_name((LeptrisElement)c), "body"))
|
|
2299
|
+
body = (LeptrisElement)c;
|
|
2300
|
+
ASSERT_NE(body, nullptr);
|
|
2301
|
+
int comments = 0, elems = 0;
|
|
2302
|
+
for (LeptrisNodeRef c = leptris_node_first_child(
|
|
2303
|
+
(LeptrisNodeRef)body);
|
|
2304
|
+
c; c = leptris_node_next_sibling((LeptrisNodeRef)c)) {
|
|
2305
|
+
if (leptris_node_get_type(c) == LEPTRIS_NODE_TYPE_COMMENT)
|
|
2306
|
+
comments++;
|
|
2307
|
+
if (leptris_node_get_type(c) == LEPTRIS_NODE_TYPE_ELEMENT)
|
|
2308
|
+
elems++;
|
|
2309
|
+
}
|
|
2310
|
+
EXPECT_EQ(comments, 1);
|
|
2311
|
+
EXPECT_EQ(elems, 1);
|
|
2312
|
+
leptris_document_free(d);
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
TEST(HtmlParse, InBodyCommentBodyFirstShape) {
|
|
2316
|
+
LeptrisStatus st;
|
|
2317
|
+
const char* doc1 = "<body><!-- c --><p>Test</p>";
|
|
2318
|
+
LeptrisDocument d = leptris_parse_html_string(doc1, strlen(doc1), &st);
|
|
2319
|
+
ASSERT_NE(d, nullptr);
|
|
2320
|
+
LeptrisElement body = nullptr;
|
|
2321
|
+
for (LeptrisNodeRef c = leptris_node_first_child(
|
|
2322
|
+
(LeptrisNodeRef)leptris_document_root(d));
|
|
2323
|
+
c; c = leptris_node_next_sibling((LeptrisNodeRef)c))
|
|
2324
|
+
if (leptris_node_get_type(c) == LEPTRIS_NODE_TYPE_ELEMENT &&
|
|
2325
|
+
h389_ieq(leptris_element_name((LeptrisElement)c), "body"))
|
|
2326
|
+
body = (LeptrisElement)c;
|
|
2327
|
+
ASSERT_NE(body, nullptr);
|
|
2328
|
+
int comments = 0;
|
|
2329
|
+
for (LeptrisNodeRef c = leptris_node_first_child(
|
|
2330
|
+
(LeptrisNodeRef)body);
|
|
2331
|
+
c; c = leptris_node_next_sibling((LeptrisNodeRef)c))
|
|
2332
|
+
if (leptris_node_get_type(c) == LEPTRIS_NODE_TYPE_COMMENT)
|
|
2333
|
+
comments++;
|
|
2334
|
+
EXPECT_EQ(comments, 1);
|
|
2335
|
+
leptris_document_free(d);
|
|
2336
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
|
3
3
|
"name": "leptris",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.370",
|
|
5
5
|
"description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
|
|
6
6
|
"homepage": "https://github.com/leptris/leptris",
|
|
7
7
|
"license": "MIT",
|