zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Johenan Li <liyuweiheng@outlook.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Discovery of 3 Bugs in Zsh
Date: Sat, 22 Apr 2023 14:03:37 -0700	[thread overview]
Message-ID: <CAH+w=7ZwauG5qsgfyAWKvtWk0d6RwUumwzo=+C5uJt8B85Poog@mail.gmail.com> (raw)
In-Reply-To: <SY4P282MB22172C2E89EB590BB4A6E6D4B8619@SY4P282MB2217.AUSP282.PROD.OUTLOOK.COM>

On Sat, Apr 22, 2023 at 10:46 AM Johenan Li <liyuweiheng@outlook.com> wrote:
>
>     #0 0x555a909ad411 in getjobtext /src/zsh/Src/text.c:338:9
>
> 0x555a916f32df is located 1 bytes to the left of global variable 'jbuf' defined in 'text.c:317:17' (0x555a916f32e0) of size 80
> 0x555a916f32df is located 30 bytes to the right of global variable 'tjob' defined in 'text.c' (0x555a916f32c0) of size 1

Perhaps there's some way to have a job with an empty jobtext?

diff --git a/Src/text.c b/Src/text.c
index 56127c457..8b1bd96b6 100644
--- a/Src/text.c
+++ b/Src/text.c
@@ -335,7 +335,7 @@ getjobtext(Eprog prog, Wordcode c)
     tlim = tptr + JOBTEXTSIZE - 1;
     tjob = 1;
     gettext2(&s);
-    if (tptr[-1] == Meta)
+    if (tptr > jbuf && tptr[-1] == Meta)
     --tptr;
     *tptr = '\0';
     freeeprog(prog);        /* mark as unused */


      parent reply	other threads:[~2023-04-22 21:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22 17:44 Johenan Li
2023-04-22 20:55 ` Bart Schaefer
2023-04-22 21:03 ` Bart Schaefer [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='CAH+w=7ZwauG5qsgfyAWKvtWk0d6RwUumwzo=+C5uJt8B85Poog@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=liyuweiheng@outlook.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).