bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read reads from stale buffer after interrupt


From: Oğuz
Subject: read reads from stale buffer after interrupt
Date: Tue, 28 May 2024 08:53:20 +0300

See:

$ while read; do :; done </dev/urandom
^C
$ read </etc/os-release; declare -p REPLY
declare -- 
REPLY=$'\025\241\375%\232\317\002D\214\023\262\262B:\377\255&;\233\350\365\223\022'
$ head -n 1 /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"

The line with ^C means I pressed Ctrl+C while the command above it is
running. It may take a few tries.

Calling zreset() from throw_to_top_level() seems to fix it but I
didn't test much. This is reproducible on 5.2.26 too.

Oğuz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]