zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Buffer overflow with long fd numbers in redirects
Date: Mon, 6 Oct 2014 16:58:11 +0200	[thread overview]
Message-ID: <CAHYJk3SX=bs4iMAWnX0ajHD1Zj6wp+_rj4FOQsT-CbYt2jfvJg@mail.gmail.com> (raw)
In-Reply-To: <20141006150900.4df5e556@pwslap01u.europe.root.pri>

On 6 October 2014 16:09, Peter Stephenson <p.stephenson@samsung.com> wrote:
> 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

Ah, I was unaware of such a thing. I'll commit it with that instead
then, thanks!

-- 
Mikael Magnusson


  reply	other threads:[~2014-10-06 14:58 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
2014-10-06 14:58   ` Mikael Magnusson [this message]
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='CAHYJk3SX=bs4iMAWnX0ajHD1Zj6wp+_rj4FOQsT-CbYt2jfvJg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=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).