Skip to content

[bug] 自引用数组守卫 ${a[@]+"${a[@]}"} 字面泄漏(杀掉 bash-completion 17KB compat 层) #147

Closed

Description

@caomengxuan666

环境

rubash 041c17e;来源=target-ecosys/REPORT.md。

现象

${a[@]+"${a[@]}"}(set -u 下的经典数组守卫写法)输出字面 ${a[@]} 文本而不是数组内容展开。bash-completion 的 17KB 兼容层依赖该写法,整体失效。

期望

GNU subst.c:嵌套的 ${a[@]+...} 中 a[@] 为 set 时展开其引号化内容;字面泄漏即词法/展开未递归处理。

Activity

  1. added
    bug
    on Sep 26, 2026
  2. caomengxuan666 commented on Sep 26, 2026

    @caomengxuan666
    MemberAuthor

    已在 78dd956 落地(29e801e1):两个独立 owner 都修了——(1) braced_alternate_word_values 的 String 快路径把 quoted "${a[@]}" 连成一个词,现在并入 $@ 检测路由到真 parser 复析;(2) compound 赋值的 catch-all 冻结字面问题,新 compound_guard_list_values 按成员扇出。锚点 subst.c:8023-8027(qdollarat)+ arrayfunc.c:557。30+ 形态矩阵双侧一致;终验:bash-completion 17KB compat 层 source rc 0,隔离矩阵 COMPLETE_COUNT 130=GNU 144−14 环境项,机制面零差。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions