From: Jim Meyering <jim@meyering.net>
To: dash@vger.kernel.org
Cc: 548493@bugs.debian.org
Subject: Re: [PATCH] don't read-uninitialized for \177 in a here-doc
Date: Mon, 28 Sep 2009 11:32:32 +0200 [thread overview]
Message-ID: <87ljjzbej3.fsf@meyering.net> (raw)
In-Reply-To: <87r5trbezu.fsf@meyering.net> (Jim Meyering's message of "Mon, 28 Sep 2009 11:22:29 +0200")
Jim Meyering wrote:
> It was indeed a bug in dash.
> I tracked it down and wrote the patch below:
>
>>From 53924ce6da7fece91e57b7238e6aa81a4df636a5 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Mon, 28 Sep 2009 11:00:05 +0200
> Subject: [PATCH] don't read-uninitialized for \177 in a here-doc
>
> A DEL (0177, dec 127) byte in a here-document would cause dash to
> access uninitialized memory at the end of one of the syntax.c tables,
> since those tables are sized to accommodate a maximum index of
> BASESYNTAX + 126. Make the generated tables one byte larger.
> printf ':<<\\E\n\200y\nE'|./dash
More details:
The above command fails as follows on certain systems, but not on others:
albeniz/sid$ printf ':<<\\E\n\177y\nE'|dash
dash: y: not found
dash: E: not found
If you want to simulate the failure consistently, simply enlarge
the sqsyntax table by one and make the last entry anything other
than CWORD. Use "11" (CEOF) and it'll evoke the symptoms shown above.
prev parent reply other threads:[~2009-09-28 9:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-28 9:22 [PATCH] don't read-uninitialized for \177 in a here-doc Jim Meyering
2009-09-28 9:32 ` Jim Meyering [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=87ljjzbej3.fsf@meyering.net \
--to=jim@meyering.net \
--cc=548493@bugs.debian.org \
--cc=dash@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox