zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Buffer overflow with long fd numbers in redirects
Date: Mon, 06 Oct 2014 15:09:00 +0100	[thread overview]
Message-ID: <20141006150900.4df5e556@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAHYJk3QeCiKGuohbduaFa9cct48oL4c2+weEQKsWpr91EM_YkQ@mail.gmail.com>

On Mon, 06 Oct 2014 16:00:44 +0200
Mikael Magnusson <mikachu@gmail.com> wrote:
> Obviously anything over 999 will not fit in fdstr[]. I just checked
> and it appears we do not use snprintf anywhere, is this for any
> particular reason?

I think the shell's been around longer than snprintf has been
widespread.  It will need checking in configure and variant code; the
latter makes the shell less safe overall.

> The patch below just changes the array to [64], it
> should be some time before any system uses a 256-bit type for fds. If
> you guys have another preference for solving this, let me know

Shouldn't DIGBUFSIZE work?

pws


  reply	other threads:[~2014-10-06 14:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 14:00 Mikael Magnusson
2014-10-06 14:09 ` Peter Stephenson [this message]
2014-10-06 14:58   ` Mikael Magnusson
2014-10-06 16:18     ` Peter Stephenson
2014-10-06 14:24 ` Axel Beckert
2014-10-06 14:55   ` Mikael Magnusson
2014-10-06 15:07   ` Bart Schaefer

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=20141006150900.4df5e556@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).