From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: ZSH crashed when reading bytes from a large binary
Date: Thu, 15 Sep 2022 11:41:34 +0100 (BST) [thread overview]
Message-ID: <505679492.743259.1663238494328@mail.virginmedia.com> (raw)
In-Reply-To: <1A4B61B5-447F-45EC-BF07-7B1041814BC6@kba.biglobe.ne.jp>
> On 15/09/2022 11:19 Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
> Consider a script something like:
>
> if read x < $file; then
> # do something
> else
> rm $file # it's empty and we can remove it
> fi
>
> Yes, this script is wrong since read returns 1 even if $file is not empty
> (if there is no \n). But I fear there may be some (only a few?) users
> using scripts like this.
There is an argument that we might be able to put in enough checking without
a rewrite to catch some particularly nasty cases --- and reading something
not under your control certainly seems to qualify as one of those.
It's still tough to catch all the levels necessary for this, though, and
it's a marginal additional benefit rather than a fix. But I'd admire
anyone with the determination to have a go.
pws
prev parent reply other threads:[~2022-09-15 10:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-11 14:43 Liu, Song
2022-09-12 7:36 ` Jun T
2022-09-14 21:43 ` Bart Schaefer
2022-09-15 10:19 ` Jun T
2022-09-15 10:41 ` Peter Stephenson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=505679492.743259.1663238494328@mail.virginmedia.com \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).