Potential Security Vulnerability: Double Free in zle_vi.c (Detected via Static Analysis)

Pasidu Rashmitha <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CABJ0pRJVvrzE=QreyUhj6TZyU-Ea_5JiPo9PhhBhncX=TCLwLg@mail.gmail.com>
Dear Zsh Maintainers,

I am Sandaru, and I’ve been analyzing the Zsh source code using the Clang
Static Analyzer (scan-build). During the analysis, I identified a potential
memory corruption issue (Double Free) in the ZLE module.

*Bug Details:*

   -

   *Type:* Double Free (Attempt to free released memory)
   -

   *File:* Src/Zle/zle_vi.c
   -

   *Function:* startvitext (Line 101/119 area)

*Analyzer Output:* The tool flagged a "Double Free" where memory is
attempted to be released after it has already been freed in a previous step
within the same execution path. This was identified among 151 other
potential issues, but this one appears to have the highest security impact
as it relates to memory management in the Vi-mode editor.

*Supporting Evidence:* I have attached the screenshots from the scan-build
report showing the exact code path and the error message. Please let me
know if you would like me to provide the full HTML report generated by the
analyzer.

Best regards, Sandaru
Screenshot_2026-05-03_18_48_05.png (image/png, 110.4 KB) - not displayed
Screenshot_2026-05-03_18_54_22.png (image/png, 99.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.