From: Kristo <kristo.ilmari@gmail.com>
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 20:32:07 +0200 [thread overview]
Message-ID: <71eb82f2-3818-4b0c-b4cc-d9976c1b6c2f@gmail.com> (raw)
In-Reply-To: <b0233255-2f1f-4797-9f41-52ecedb7d4ef@posixcafe.org>
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
next prev parent reply other threads:[~2024-01-23 18:33 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 [this message]
2024-01-23 21:27 ` Jacob Moody
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=71eb82f2-3818-4b0c-b4cc-d9976c1b6c2f@gmail.com \
--to=kristo.ilmari@gmail.com \
--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).