Revert "src: add aliased-buffer-overflow abort test"

This reverts commit babeb58c52.

PR-URL: https://github.com/nodejs/node/pull/33196
Refs: https://github.com/nodejs/node/pull/31740
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Richard Lau committed 2020-05-06 09:39:43 -04:00
1 parent 86fdaa7455
commit a22991b044
4 files changed
-68

No files matched your search

-8
View File
@@ -1,8 +0,0 @@
{
'defines': [ 'V8_DEPRECATION_WARNINGS=1', 'NODE_WANT_INTERNALS=1' ],
'conditions': [
[ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
'cflags': ['-Wno-cast-function-type'],
}],
],
}
@@ -1,23 +0,0 @@
#include <stdlib.h>
#include <node.h>
#include <v8.h>
#include <aliased_buffer.h>
#include <util-inl.h>
void AllocateAndResizeBuffer(
const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
int64_t length = args[0].As<v8::BigInt>()->Int64Value();
node::AliasedBigUint64Array array{isolate, 0};
array.reserve(length);
assert(false);
}
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports,
"allocateAndResizeBuffer",
AllocateAndResizeBuffer);
}
@@ -1,9 +0,0 @@
{
'targets': [
{
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
}
]
}
@@ -1,28 +0,0 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
// This test ensures that during resizing of an Aliased*Array the computation
// of the new size does not overflow.
if (process.argv[2] === 'child') {
// test
const binding = require(`./build/${common.buildType}/binding`);
const bigValue = BigInt('0xE000 0000 E000 0000');
binding.AllocateAndResizeBuffer(bigValue);
assert.fail('this should be unreachable');
} else {
// observer
const child = cp.spawn(`${process.execPath}`, [`${__filename}`, 'child']);
child.on('exit', common.mustCall(function(code, signal) {
if (common.isWindows) {
assert.strictEqual(code, 134);
assert.strictEqual(signal, null);
} else {
assert.strictEqual(code, null);
assert.strictEqual(signal, 'SIGABRT');
}
}));
}