惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
A
About on SuperTechFans
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
罗磊的独立博客
量子位
有赞技术团队
有赞技术团队
V
V2EX
Engineering at Meta
Engineering at Meta

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: reject malformed inspected tcp ports · openclaw/open...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -76,19 +76,27 @@ function normalizeTcpHost(host: string): string {

7676

return normalized.startsWith("::ffff:") ? normalized.slice("::ffff:".length) : normalized;

7777

}

7878
79+

function parseTcpPort(raw: string | undefined): number | null {

80+

if (!raw || !/^\d+$/.test(raw)) {

81+

return null;

82+

}

83+

const port = Number(raw);

84+

return Number.isSafeInteger(port) && port >= 0 && port <= 65_535 ? port : null;

85+

}

86+
7987

function parseTcpEndpoint(raw: string): { host: string; port: number } | null {

8088

const endpoint = raw.trim();

8189

const bracketMatch = endpoint.match(/^\[([^\]]+)\]:(\d+)$/);

8290

if (bracketMatch) {

83-

const port = Number.parseInt(bracketMatch[2], 10);

84-

return Number.isFinite(port) ? { host: normalizeTcpHost(bracketMatch[1]), port } : null;

91+

const port = parseTcpPort(bracketMatch[2]);

92+

return port === null ? null : { host: normalizeTcpHost(bracketMatch[1]), port };

8593

}

8694

const lastColon = endpoint.lastIndexOf(":");

8795

if (lastColon <= 0 || lastColon >= endpoint.length - 1) {

8896

return null;

8997

}

90-

const port = Number.parseInt(endpoint.slice(lastColon + 1), 10);

91-

if (!Number.isFinite(port)) {

98+

const port = parseTcpPort(endpoint.slice(lastColon + 1));

99+

if (port === null) {

92100

return null;

93101

}

94102

return { host: normalizeTcpHost(endpoint.slice(0, lastColon)), port };

Original file line numberDiff line numberDiff line change

@@ -206,6 +206,8 @@ describeUnix("inspectPortUsage", () => {

206206

"p111\ncnode\nnTCP 127.0.0.1:50123->127.0.0.1:18789 (ESTABLISHED)\n" +

207207

"p222\ncnode\nnTCP 127.0.0.1:18789->127.0.0.1:50123 (ESTABLISHED)\n" +

208208

"p444\ncnode\nnTCP 127.0.0.1:50125->[::ffff:127.0.0.1]:18789 (ESTABLISHED)\n" +

209+

"p555\ncnode\nnTCP 127.0.0.1:50126->127.0.0.1:18789abc (ESTABLISHED)\n" +

210+

"p666\ncnode\nnTCP 127.0.0.1:50127->127.0.0.1:99999 (ESTABLISHED)\n" +

209211

"p333\ncBrowser\nnTCP 127.0.0.1:50124->198.51.100.7:18789 (ESTABLISHED)\n",

210212

stderr: "",

211213

code: 0,