summaryrefslogtreecommitdiffhomepage
path: root/web/assets/git@git.abendless.com:/srv
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-28 00:30:30 -0600
committerSean Kurtz <seankurtz75@gmail.com>2026-11-28 00:30:30 -0600
commit56bd0e6c2ab87ab140cef35882cff52153f36b7c (patch)
treeca97d8d3c64a1dc2d4afbce14e157505d7642949 /web/assets/git@git.abendless.com:/srv
parenta5a920383fe85f4dada0cb80418f7a935c12dc4a (diff)
downloadzash-56bd0e6c2ab87ab140cef35882cff52153f36b7c.tar.gz
fix(edit): vi `y` keeps the line and never pastes the old kill
`y0` with the cursor at column 0 yanks an empty range, and the old code then inserted the kill buffer at the cursor: with nothing killed yet that was memcpy(dst, nullptr, 0), which UBSan rejects at src/edit_builtin.c:375; with an earlier `cw` behind it, the old kill text was pasted into the line (vi `y` changes nothing on the line). The `y` case now copies the range into the kill buffer with kill_set() - the same block remove_range() used - and puts the cursor at the start of the range, which is where vi leaves it. insert() also returns early for an empty string, so a later caller cannot repeat the null memcpy. Test: tests/linux/i-vi.sh yanks an empty range after a `cw`, so the kill buffer holds text that must not appear. Before the change UBSan reports "null pointer passed as argument 2" and the line comes out as "oneecho yank"; after it, the line is "echo yank". Verified on Linux with make check and the same pty session under ASan+UBSan.
Diffstat (limited to 'web/assets/git@git.abendless.com:/srv')
0 files changed, 0 insertions, 0 deletions