9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Jacob Moody <moody@posixcafe.org>
To: 9front@9front.org
Subject: Re: [9front] [PATCH] awk: don't write an extra NUL past the end of a block
Date: Tue, 23 Jan 2024 15:27:22 -0600	[thread overview]
Message-ID: <fe1aa491-2fb1-45d0-a390-25d23a081bcf@posixcafe.org> (raw)
In-Reply-To: <71eb82f2-3818-4b0c-b4cc-d9976c1b6c2f@gmail.com>

Thanks! I committed the solution from onetrueawk.

On 1/23/24 12:32, Kristo wrote:
> On 23.1.2024 18.53, Jacob Moody wrote:
>> Maybe give onetrueawk a try and see if you can reproduce the
>> crash there as well, and if not perhaps we should copy their fix.
> 
> Not sure why I didn't realize to do this while debugging, indeed their
> fix seems to be to allocate one more byte few lines above.
> 
> if ((fields = (char *) malloc(n+2)) == NULL) /* possibly 2 final \0s */
> 
> https://github.com/onetrueawk/awk/blob/master/lib.c#L394
> 
> I'm in favor of copying their fix as I can't say that I have a super
> deep understanding of awk's internals.
> 
> Kristo


      reply	other threads:[~2024-01-23 21:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  7:44 Kristo
2024-01-23 16:53 ` Jacob Moody
2024-01-23 17:40   ` qwx
2024-01-23 17:45     ` qwx
2024-01-23 17:50       ` Jacob Moody
2024-01-23 18:47         ` Aw: " Alexander Shendi
2024-01-23 18:32   ` Kristo
2024-01-23 21:27     ` Jacob Moody [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=fe1aa491-2fb1-45d0-a390-25d23a081bcf@posixcafe.org \
    --to=moody@posixcafe.org \
    --cc=9front@9front.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;
as well as URLs for NNTP newsgroup(s).