zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Another minor =~ glitch
Date: Wed, 14 Jun 2017 06:45:21 +0200	[thread overview]
Message-ID: <CAHYJk3TgQ6bQUWmsLSSHop9TD0nEXPgNW2=k_c4owWSSsENr1w@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Yg2spHiw=vCgTHv3k1caW36qtv6az1th3YCHqUD70i8w@mail.gmail.com>

On Sat, Apr 8, 2017 at 7:23 AM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Fri, Apr 7, 2017 at 6:58 PM, Roland Eggner <edvz2@systemanalysen.net> wrote:
>>
>> Regression observed since my Zsh update
>> from bb6c08b51a079870 to fc1fedda954e1d10.
>
> Thanks, that narrows it down to this:
>
> diff --git a/Src/cond.c b/Src/cond.c
> index 9b739f6..a638412 100644
> --- a/Src/cond.c
> +++ b/Src/cond.c
> @@ -139,9 +139,9 @@ evalcond(Estate state, char *fromtest)
>                 l = 2;
>             }
>             if (name && IS_DASH(name[0]))
> -               errname = name;
> +               untokenize(errname = name);
>             else if (strs[0] && IS_DASH(*strs[0]))
> -               errname = strs[0];
> +               untokenize(errname = strs[0]);
>             else
>                 errname = "<null>";
>             if (name && IS_DASH(name[0]) &&

This patch causes segfaults for me (in the first hunk at least)
because name can be a readonly string. Should we ztrdup it?

-- 
Mikael Magnusson


  reply	other threads:[~2017-06-14  4:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 17:33 Bart Schaefer
2017-04-08  1:58 ` Roland Eggner
2017-04-08  5:23   ` Bart Schaefer
2017-06-14  4:45     ` Mikael Magnusson [this message]
2017-06-14  4:49       ` Mikael Magnusson
2017-06-19 10:06       ` PATCH: dupstring a possibly readonly string before modifying Mikael Magnusson

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='CAHYJk3TgQ6bQUWmsLSSHop9TD0nEXPgNW2=k_c4owWSSsENr1w@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.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).