msgpackr-extract 3.0.3 → 3.0.4
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.
- package/package.json +8 -8
- package/src/extract.cpp +5 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msgpackr-extract",
|
|
3
3
|
"author": "Kris Zyp",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.4",
|
|
5
5
|
"description": "Node addon for string extraction for msgpackr",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prebuild-libc": "prebuildify-platform-packages --tag-libc --target 20.14.0 && prebuildify-platform-packages --platform-packages --napi --tag-libc --target 22.2.0 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --platform-packages --napi --tag-libc --target 20.14.0",
|
|
18
18
|
"prebuild-libc-napi": "ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --platform-packages --napi --tag-libc --target 20.14.0",
|
|
19
19
|
"prebuild-libc-alpine": "prebuildify-cross --image alpine --tag-libc --target 20.14.0",
|
|
20
|
-
"publish-all": "cd prebuilds/win32-x64 && npm publish --access public && cd ../darwin-x64 && npm publish --access public && cd ../darwin-arm64 && npm publish --access public && cd ../linux-x64 && npm publish --access public && cd ../linux-arm64 && npm publish --access public
|
|
20
|
+
"publish-all": "cd prebuilds/win32-x64 && (npm publish --access public || true) && cd ../darwin-x64 && (npm publish --access public || true) && cd ../darwin-arm64 && (npm publish --access public || true) && cd ../linux-x64 && (npm publish --access public || true) && cd ../linux-arm64 && (npm publish --access public || true) && cd ../linux-arm && (npm publish --access public || true) && cd ../.. && npm publish --access public",
|
|
21
21
|
"test": "node ./index.js"
|
|
22
22
|
},
|
|
23
23
|
"main": "./index.js",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"download-msgpackr-prebuilds": "./bin/download-prebuilds.js"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.
|
|
39
|
-
"@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.
|
|
40
|
-
"@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.
|
|
41
|
-
"@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.
|
|
42
|
-
"@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.
|
|
43
|
-
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.
|
|
38
|
+
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.4",
|
|
39
|
+
"@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.4",
|
|
40
|
+
"@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.4",
|
|
41
|
+
"@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.4",
|
|
42
|
+
"@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.4",
|
|
43
|
+
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.4"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"prebuildify-platform-packages": "5.0.4",
|
package/src/extract.cpp
CHANGED
|
@@ -131,7 +131,7 @@ public:
|
|
|
131
131
|
length += source[position++] << 16;
|
|
132
132
|
length += source[position++] << 8;
|
|
133
133
|
length += source[position++];
|
|
134
|
-
if (length
|
|
134
|
+
if (length > size - position) {
|
|
135
135
|
return unexpectedEnd(env);
|
|
136
136
|
}
|
|
137
137
|
readString(env, length, false, target);
|
|
@@ -220,6 +220,8 @@ void setupTokenTable() {
|
|
|
220
220
|
length += source[position++] << 16;
|
|
221
221
|
length += source[position++] << 8;
|
|
222
222
|
length += source[position++];
|
|
223
|
+
if (length > size - position)
|
|
224
|
+
return UNEXPECTED_END;
|
|
223
225
|
return position + length;
|
|
224
226
|
});
|
|
225
227
|
// ext 8
|
|
@@ -247,6 +249,8 @@ void setupTokenTable() {
|
|
|
247
249
|
length += source[position++] << 16;
|
|
248
250
|
length += source[position++] << 8;
|
|
249
251
|
length += source[position++];
|
|
252
|
+
if (length >= size - position)
|
|
253
|
+
return UNEXPECTED_END;
|
|
250
254
|
position++;
|
|
251
255
|
return position + length;
|
|
252
256
|
});
|