yeptris 0.6.74.0 → 0.6.75.0
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/lib/yeptris.rb +1 -1
- data/vendor/libyeptris/CMakeLists.txt +1 -1
- data/vendor/libyeptris/src/yeptris/dom/dom.c +18 -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: 32d32a550526edc74ca4b515f672bdae1bfa5ff27255ddf8ba32819685c71c91
|
|
4
|
+
data.tar.gz: 0ed1184c11dd7103b575326f06a2af4c083bdfdaf3eefe9920e033a91c599275
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62a9680473b34c106ad53347d851a38cd4ce90296224f2ceb0fa5429290980a6350241c239b52a7836433e4ee1b6032e06410e8adedd9728aff80896000616ee
|
|
7
|
+
data.tar.gz: 68a4c8a8f2be594e70f679c5ae6df738b723ab8740fbae5bdf1316e5238a9497f887e5d710acfaf4026be819b6b9d53408b8cce8ac85d4e4b9aabc82c8c31a95
|
data/lib/yeptris.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Yeptris
|
|
4
4
|
# The gem's version lives in the parent namespace's file — the last
|
|
5
5
|
# internal require (yeptris/version) retired with it.
|
|
6
|
-
VERSION = "0.6.
|
|
6
|
+
VERSION = "0.6.75.0".freeze
|
|
7
7
|
|
|
8
8
|
# Informational notices are OPT-IN (yeptris-ruby#217): consumers
|
|
9
9
|
# embed yeptris inside CLIs that assert clean stderr, and a
|
|
@@ -122,6 +122,23 @@ yep_sview yep_dom_str_put(yep_dom* d, const char* p, uint32_t len) {
|
|
|
122
122
|
if (len == 0) {
|
|
123
123
|
return sv;
|
|
124
124
|
}
|
|
125
|
+
/* p may point INTO d->str itself (the sinks stage tag/value pieces
|
|
126
|
+
* via yep_dom_str_tail + yep_dom_str_commit, then re-encode the
|
|
127
|
+
* committed view through dom_str_in): snapshot the self-offset
|
|
128
|
+
* BEFORE str_grow — the grow reallocates and frees the old buffer
|
|
129
|
+
* (the #1468 heap-use-after-free). A staged piece is always
|
|
130
|
+
* committed first, so the region read is within str_len. */
|
|
131
|
+
uint32_t self_off = UINT32_MAX;
|
|
132
|
+
if (d->str != NULL && p >= d->str && p <= d->str + d->str_len) {
|
|
133
|
+
uint64_t off = (uint64_t)(p - d->str);
|
|
134
|
+
if (off + len > d->str_len) {
|
|
135
|
+
/* a staged region extending past str_len would be garbage
|
|
136
|
+
* after the grow — treat as OOM rather than corrupt */
|
|
137
|
+
d->oom = 1;
|
|
138
|
+
return sv;
|
|
139
|
+
}
|
|
140
|
+
self_off = (uint32_t)off;
|
|
141
|
+
}
|
|
125
142
|
if (!str_grow(d, len)) {
|
|
126
143
|
/* OOM: an empty view here would silently corrupt the document
|
|
127
144
|
* (the value reads as ""). Record it; dom_place/dom_open_node
|
|
@@ -129,7 +146,7 @@ yep_sview yep_dom_str_put(yep_dom* d, const char* p, uint32_t len) {
|
|
|
129
146
|
d->oom = 1;
|
|
130
147
|
return sv;
|
|
131
148
|
}
|
|
132
|
-
memcpy(d->str + d->str_len, p, len);
|
|
149
|
+
memcpy(d->str + d->str_len, self_off == UINT32_MAX ? p : d->str + self_off, len);
|
|
133
150
|
sv.off = YEP_SV_INPUT | d->str_len;
|
|
134
151
|
sv.len = len;
|
|
135
152
|
d->str_len += len;
|