- M0: libghostty SSH 终端(渲染/输入/连接)+ 白屏修复(OutputGate) + 会话状态机/自动重连 - M1: tsnet 用户态组网 + SSH-over-tsnet(fd 桥),shell 级真机验证;R5(Go+gvisor+C+++Swift 同进程) retire - M1.5: tmux -CC 原生 tab(MVP) - 结构: packages/(TXCore·TXTransport), apps/TerminalX, vendor/(libghostty-spm/libssh2/mbedtls/tsnet-bridge), artifacts/ - 文档: CLAUDE.md + docs/HANDOFF.md(新会话入口) - 环境: 认证代理→依赖 vendor 本地化;Go 在 ~/.local/go;仅模拟器/未签名 - 待续: M2 mosh, tmux 多 pane, M4 安全(host key/SE) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
48 lines
1.2 KiB
Perl
Executable File
48 lines
1.2 KiB
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
# Find functions making recursive calls to themselves.
|
|
# (Multiple recursion where a() calls b() which calls a() not covered.)
|
|
#
|
|
# When the recursion depth might depend on data controlled by the attacker in
|
|
# an unbounded way, those functions should use iteration instead.
|
|
#
|
|
# Typical usage: framework/scripts/recursion.pl library/*.c
|
|
#
|
|
# Copyright The Mbed TLS Contributors
|
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
use utf8;
|
|
use open qw(:std utf8);
|
|
|
|
# exclude functions that are ok:
|
|
# - mpi_write_hlp: bounded by size of mbedtls_mpi, a compile-time constant
|
|
# - x509_crt_verify_child: bounded by MBEDTLS_X509_MAX_INTERMEDIATE_CA
|
|
my $known_ok = qr/mpi_write_hlp|x509_crt_verify_child/;
|
|
|
|
my $cur_name;
|
|
my $inside;
|
|
my @funcs;
|
|
|
|
die "Usage: $0 file.c [...]\n" unless @ARGV;
|
|
|
|
while (<>)
|
|
{
|
|
if( /^[^\/#{}\s]/ && ! /\[.*]/ ) {
|
|
chomp( $cur_name = $_ ) unless $inside;
|
|
} elsif( /^{/ && $cur_name ) {
|
|
$inside = 1;
|
|
$cur_name =~ s/.* ([^ ]*)\(.*/$1/;
|
|
} elsif( /^}/ && $inside ) {
|
|
undef $inside;
|
|
undef $cur_name;
|
|
} elsif( $inside && /\b\Q$cur_name\E\([^)]/ ) {
|
|
push @funcs, $cur_name unless /$known_ok/;
|
|
}
|
|
}
|
|
|
|
print "$_\n" for @funcs;
|
|
exit @funcs;
|