+1
-0
@@ -180,2 +180,3 @@ #include "./wrapped_re2.h" | ||
| auto argSize = node::Buffer::Length(arg); | ||
| // isAscii stays false: every consumer branches on isBuffer first, so computing it would be a dead O(n) scan. | ||
| lastStringValue.reset(arg, argSize, argSize, startFrom, true); | ||
@@ -182,0 +183,0 @@ |
+3
-3
@@ -316,3 +316,3 @@ #include "./pattern.h" | ||
| result += "\\"; | ||
| size_t sym_size = getUtf8CharSize(ch); | ||
| size_t sym_size = getUtf8CharSize(ch, size - (i + 1)); | ||
| result.append(data + i + 1, sym_size); | ||
@@ -349,3 +349,3 @@ i += sym_size + 1; | ||
| } | ||
| size_t sym_size = getUtf8CharSize(ch); | ||
| size_t sym_size = getUtf8CharSize(ch, size - i); | ||
| result.append(data + i, sym_size); | ||
@@ -395,3 +395,3 @@ i += sym_size; | ||
| } | ||
| size_t sym_size = getUtf8CharSize(ch); | ||
| size_t sym_size = getUtf8CharSize(ch, size - i); | ||
| result.append(data + i, sym_size); | ||
@@ -398,0 +398,0 @@ i += sym_size; |
+3
-3
@@ -206,3 +206,3 @@ #include "./wrapped_re2.h" | ||
| } | ||
| size_t sym_size = getUtf8CharSize(ch); | ||
| size_t sym_size = getUtf8CharSize(ch, size - i); | ||
| result.append(data + i, sym_size); | ||
@@ -266,3 +266,3 @@ i += sym_size; | ||
| { | ||
| auto sym_size = getUtf8CharSize(data[offset]); | ||
| auto sym_size = getUtf8CharSize(data[offset], size - (size_t)offset); | ||
| result.append(data + offset, sym_size); | ||
@@ -454,3 +454,3 @@ byteIndex = offset + sym_size; | ||
| { | ||
| auto sym_size = getUtf8CharSize(data[offset]); | ||
| auto sym_size = getUtf8CharSize(data[offset], size - (size_t)offset); | ||
| result.append(data + offset, sym_size); | ||
@@ -457,0 +457,0 @@ byteIndex = offset + sym_size; |
+1
-1
@@ -52,3 +52,3 @@ #include "./wrapped_re2.h" | ||
| { | ||
| size_t sym_size = getUtf8CharSize(str.data[byteIndex]); | ||
| size_t sym_size = getUtf8CharSize(str.data[byteIndex], str.size - byteIndex); | ||
| pieces.push_back(re2::StringPiece(str.data + byteIndex, sym_size)); | ||
@@ -55,0 +55,0 @@ byteIndex += sym_size; |
@@ -235,2 +235,11 @@ #pragma once | ||
| // Buffer input is never re-encoded, so a lead byte can promise more continuation | ||
| // bytes than the input actually holds; use this form wherever the result indexes | ||
| // the buffer, or the read runs past the end (GHSA/#272). | ||
| inline size_t getUtf8CharSize(char ch, size_t remaining) | ||
| { | ||
| size_t size = getUtf8CharSize(ch); | ||
| return size < remaining ? size : remaining; | ||
| } | ||
| // V8 13.4 introduced Utf8LengthV2 / WriteUtf8V2; V8 14.6 removed the bare | ||
@@ -237,0 +246,0 @@ // Utf8Length / WriteUtf8. On older V8 (Node 22) only the bare forms exist. |
+32
-32
| { | ||
| "name": "re2", | ||
| "version": "1.26.0", | ||
| "version": "1.26.1", | ||
| "description": "Bindings for RE2: fast, safe alternative to backtracking regular expression engines.", | ||
@@ -21,13 +21,13 @@ "homepage": "https://github.com/uhop/node-re2", | ||
| "install-artifact-from-github": "^1.7.0", | ||
| "nan": "^2.27.0", | ||
| "node-gyp": "^13.0.0" | ||
| "nan": "^2.28.0", | ||
| "node-gyp": "^13.0.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^26.0.1", | ||
| "@types/node": "^26.1.1", | ||
| "@unicode/unicode-17.0.0": "^1.6.17", | ||
| "nano-benchmark": "^1.0.16", | ||
| "prettier": "^3.8.4", | ||
| "tape-six": "^1.14.0", | ||
| "nano-benchmark": "^1.2.0", | ||
| "prettier": "^3.9.5", | ||
| "tape-six": "^1.15.0", | ||
| "tape-six-proc": "^1.3.1", | ||
| "typescript": "^6.0.3" | ||
| "typescript": "^7.0.2" | ||
| }, | ||
@@ -78,27 +78,27 @@ "scripts": { | ||
| "artifactHashes": { | ||
| "darwin-arm64-127": "sha256:ee6ab29e4827d1373145cfb75ef16584fa62aa4231f4d0cb6563d8f17e9562ba", | ||
| "darwin-arm64-137": "sha256:1c7092bd5b422c40f54c3d7dc34f5907285a0cd44ff4d638b862d84754d28147", | ||
| "darwin-arm64-147": "sha256:7e0ed56cc8c9041ba01227c3cb6baa976eaf5fd6f7eaf78064dcdd22b0e2e13d", | ||
| "darwin-x64-127": "sha256:2eff49ac19346b316fc19d6d99752eefac50a68d52882f9b449ee75937f7ef11", | ||
| "darwin-x64-137": "sha256:a034c96ec3bff397bc5e5f629f0c79f72c42aac91e3c234424d09ec2ba6d55f0", | ||
| "darwin-x64-147": "sha256:1772726792f2171a77bf5b5186612ce58a36be349cc6e5191986cd66925bbd65", | ||
| "linux-arm64-127": "sha256:11953057e63ba205c1d27b4145955c4f671d5b086bb98f7a2309c689639c8533", | ||
| "linux-arm64-137": "sha256:3b3920e2cce296fc75f9e1a3a70940d1ed9858ffc525aae03a897e61e75bba87", | ||
| "linux-arm64-147": "sha256:94938e8a5f9cbcd4ecde45d6b29fc526a19b2db1e8e7fb3aa280a4a58fc1bf0e", | ||
| "linux-musl-arm64-127": "sha256:51125be7c782612e89ed07cf3b695e7de63953c272f51be321ecbf170c258389", | ||
| "linux-musl-arm64-137": "sha256:34c78f56c986a0b2eff017dd173c5280531df70512dbec0cd33915c01ad42cd1", | ||
| "linux-musl-arm64-147": "sha256:fbf80ece0901a242191d9d26a18664cad8ba9785e141990deb04e6efc8665af3", | ||
| "linux-musl-x64-127": "sha256:569cc2d01e26e299a0f3d719f67603442e8e2045315ca2cac995504c1480fe99", | ||
| "linux-musl-x64-137": "sha256:89991ff4439e93b27539c0d81c17d05e5752814996464c835d2c646e785cecea", | ||
| "linux-musl-x64-147": "sha256:121e9d5f7af6f75b4a1d2b3bab514f514c7d93101e8eb992bd3e9fb2765f857d", | ||
| "linux-x64-127": "sha256:3218e8a6daba6d70e525668c76d9a955d383c45266e49c52fb716828e9bf1771", | ||
| "linux-x64-137": "sha256:a0a0e9a261625f7a982851d3f069dd7f3a370399f5be90b1922835ac6bf66be8", | ||
| "linux-x64-147": "sha256:140286223194fe98650a72da7de8f893cd51b72f607c401f62d7d5c860e2e992", | ||
| "win32-arm64-127": "sha256:cb763db7c2a21ac4557946df9b0239a3e51db8b7fca7adb7d74adb4317e846b7", | ||
| "win32-arm64-137": "sha256:469db40cd5ad51f16652d3d122e37ea4e448dd43691cd3f935905e462f0634df", | ||
| "win32-arm64-147": "sha256:8c9505f8e0a85c437163bbbc10556e8fa4938d03dba063d4516ae34301f46020", | ||
| "win32-x64-127": "sha256:c97d9a0ab350720a01e367d62956b5f85d645613fcb71b5047b41a1806f6d609", | ||
| "win32-x64-137": "sha256:0d729f3b2e965fad8c1cec2f16dd8b4adcc7d55b80580d3ec96b5a56ef0c443b", | ||
| "win32-x64-147": "sha256:425fa904163218fd1f96692838a04955b3fd148604c4e455dc8a17527e5c6717" | ||
| "darwin-arm64-127": "sha256:704e94698aa3dd3548d50a347ef4cfb80f7170d061f3afb0659ca38f7b638cfb", | ||
| "darwin-arm64-137": "sha256:009c625301fef69a97637bf020e5b5be1c08daff390282d591d59c3d3b36da95", | ||
| "darwin-arm64-147": "sha256:2ea66f80276df9c545a8c0ee828edc6aa498398a9d451de79ef15e3e9ed31943", | ||
| "darwin-x64-127": "sha256:a2e5b2e8d53a4ac86ed9e7ef508be6150a0cc37bfe496a0dda52fae4efa3bf4b", | ||
| "darwin-x64-137": "sha256:2f54b250ca0874e1f35cd4479c378fe9defc00bac67675a5f24b0bacb07367e6", | ||
| "darwin-x64-147": "sha256:cf573387b4f05950d9484fb7696a23a755cf8d18f5d076870c5e73db94718807", | ||
| "linux-arm64-127": "sha256:3e4cdb0f619ac2e65ddbfac737313fc1983e4b6ddb430d35ee2766c2145d8850", | ||
| "linux-arm64-137": "sha256:53abb406bc10558bad2b0bd3c1b3ab30ee4390bf10037effe38844eda1b7aae2", | ||
| "linux-arm64-147": "sha256:209cc39769a08f0fff7e689ba3b46b0a69f1d634b04ee2427873c43bbc11c39d", | ||
| "linux-musl-arm64-127": "sha256:d0de1dcaab3cd20478f6848997e31f503ec2bf57bb304d1a98cacdf8c1ecbfb7", | ||
| "linux-musl-arm64-137": "sha256:ee64f1391712d8583711981f2098feb9b9fdc9dcd5cbfe98e43a5f2a57465bf2", | ||
| "linux-musl-arm64-147": "sha256:ea61d8029f9ec79b2e75b32095e217d1a1744db872b77631229936b0e36d5c62", | ||
| "linux-musl-x64-127": "sha256:70b2f7c350d31ec2ad360c39a2588ba70b743fb9be8e4271c5b72d9a1fb29914", | ||
| "linux-musl-x64-137": "sha256:734b08b934060a7a6550db222e5887e21ecf8f0acd0566e30611ffd065d517c1", | ||
| "linux-musl-x64-147": "sha256:0e4f208f1c4c50b2c9b6fc6d7de6b8a05d05ec476c1e953a367318ad6c7b20a8", | ||
| "linux-x64-127": "sha256:16172453d3bbb18fa598d7978dff82f9d7afb35e9976c82d8d5194a23abc706d", | ||
| "linux-x64-137": "sha256:4ce5672c82f5876652e1b35461df4529e085d307f3f840009a17e88c700eb094", | ||
| "linux-x64-147": "sha256:5f4dc40978c44d75c83c2bcec3ad4eb7a72ebc2986f49eee5bc43792060a959a", | ||
| "win32-arm64-127": "sha256:22ec1e32dc0c34f25dbaf3818cef2e69e536fcbac58d58f99dfb454057a6500b", | ||
| "win32-arm64-137": "sha256:a0b86fa1511c52539cb495c3bae9588068e40642b4bc286b78b7846255db174d", | ||
| "win32-arm64-147": "sha256:93cfc3ccfc673acd48aee89835065cb0a35198a353abcaa2feec0a45f83a50a1", | ||
| "win32-x64-127": "sha256:fe2570c73830062cfe72624444b021eb6eb3911b35736a2b4ad8a66edd035b5e", | ||
| "win32-x64-137": "sha256:2b6e2205a0fec4eedfe116ac577c34bc2f0f9ba2d17cf4d5e3e9f07004216134", | ||
| "win32-x64-147": "sha256:05f04cae766a5ae374f555a89d1168fd7a70efd50c8d8e160bf9356329da263b" | ||
| } | ||
| } |
+1
-0
@@ -439,2 +439,3 @@ # node-re2 [![NPM version][npm-img]][npm-url] | ||
| - 1.26.1 *Security fix (#272): a `Buffer` subject, pattern, or replacement ending in a truncated multi-byte UTF-8 character no longer reads past the end of the buffer — for `replace()` and `split()` those stray bytes were copied into the returned `Buffer`. Buffer input only; strings were never affected. Thx, [OvOhao](https://github.com/OvOhao).* | ||
| - 1.26.0 *Verified prebuilt downloads. Thx, [ataberk-xyz](https://github.com/ataberk-xyz).* | ||
@@ -441,0 +442,0 @@ - 1.25.2 *Two DoS security fixes: a global `match()` with an empty-matchable pattern (`a*`, `(?:)`, …) no longer loops forever exhausting memory (GHSA-6hxr-mr5r-9836), and an out-of-range `lastIndex` on a non-ASCII subject no longer reads past the buffer and crashes (GHSA-ff84-5f28-78qj). Both now match the built-in engine. Thx, [ataberk-xyz](https://github.com/ataberk-xyz).* |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
13141152
0.01%479
0.21%1
-50%Updated
Updated