GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sea: reject trailing content in config JSON · nodejs/node@64a8843

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_sea.cc
  • test/sea
    • test-single-executable-blob-config-errors.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_sea.cc‎

Copy file name to clipboardExpand all lines: src/node_sea.cc
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,14 @@ std::optional<SeaConfig> ParseSingleExecutableConfig(
541541
}
542542
}
543543

544+
if (!document.at_end()) {
545+
FPrintF(stderr,
546+
"Cannot parse JSON from %s: %s\n",
547+
config_path,
548+
simdjson::error_message(simdjson::TRAILING_CONTENT));
549+
return std::nullopt;
550+
}
551+
544552
if (static_cast<bool>(result.flags & SeaFlags::kUseSnapshot) &&
545553
static_cast<bool>(result.flags & SeaFlags::kUseCodeCache)) {
546554
// TODO(joyeecheung): code cache in snapshot should be configured by
Collapse file

‎test/sea/test-single-executable-blob-config-errors.js‎

Copy file name to clipboardExpand all lines: test/sea/test-single-executable-blob-config-errors.js
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ const { spawnSyncAndAssert } = require('../common/child_process');
4747
});
4848
}
4949

50+
{
51+
tmpdir.refresh();
52+
const config = tmpdir.resolve('trailing-content.json');
53+
writeFileSync(
54+
config,
55+
'{"main":"bundle.js","output":"sea.blob"}{}',
56+
'utf8',
57+
);
58+
spawnSyncAndAssert(
59+
process.execPath,
60+
['--experimental-sea-config', config], {
61+
cwd: tmpdir.path,
62+
}, {
63+
status: 1,
64+
stderr: /TRAILING_CONTENT/,
65+
});
66+
}
67+
5068
{
5169
tmpdir.refresh();
5270
const config = tmpdir.resolve('empty.json');

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.