Skip to content

truncate对参数2没有限制,过大参数会卡死shell #11

@cyberhorse208

Description

@cyberhorse208

/home/Projects/blueos-dev/out/shell_test/bin/shell_runner-qemu.sh

输入了 32+0 块记录
输出了 32+0 块记录
33554432 字节 (34 MB, 32 MiB) 已复制,0.0214931 s,1.6 GB/s
Hello, shell!
> ls
dev/
proc/
> touch a.txt
> truncate a.txt 1024000000

建议:
在truncate中加入参数校验,限制过大参数

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions