leptris 1.9.368.1-aarch64-linux → 1.9.370.0-aarch64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a55d9429274a6351b83c25eb8a3e366a5cd1ea7effc953661ee0ba125607d58
4
- data.tar.gz: 824310d407eefe2202433914bf71a25eae55ac5bd6ddbae8e8577837c0a24955
3
+ metadata.gz: a3d358fab2e812dfe82e177d601ca62c5e43e3392582a47569de67dd19f9dd78
4
+ data.tar.gz: 7d4ec42ca0d1024740566a2c76b5078db549ff372fc4d31c86a6e21abd096581
5
5
  SHA512:
6
- metadata.gz: 191bd7787891ea2ef62337b6f858cb43db048f58ad1cb83cba4dd5635298430884d221fdabbe8d663797a5e405ecaa804bc53fef2ef6b3abb9484f3a99f6a7cf
7
- data.tar.gz: 0defbddcc67344faef208aaecc7d06b833b87d967c8731a7f08d95eacf142600052af1f304aff6e92323ac624bc3999eb91e7836390f559e787390ae873e990c
6
+ metadata.gz: 2aa939744bd1bfdcb74978308bf337ef3fc93fdb9a1427683c9d6d9cb6d37de346b447f4c3e184cc9853eb7797dc106529a404b518aacdceafecd1dd0da7c0d4
7
+ data.tar.gz: 47d69f33b7b5b4ced5b5bcb17888e594d4e107fd32bc8ee8619ed3ef2df8b769396778a73ada8ae4b0720e15d945f87bb7a473783b8f3fb11cc8e80b9a9d5a3c
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.368"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.368.1"
4
+ VERSION = "1.9.370.0"
5
5
  end
data/lib/libleptris.so CHANGED
Binary file
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.368
4
+ - libleptris v1.9.370
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -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
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.368
6
+ VERSION 1.9.370
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -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.368",
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",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.368.1
4
+ version: 1.9.370.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.