List for cgit developers and users
 help / color / mirror / Atom feed
From: Christian Hesse <list@eworm.de>
To: lemon <lsof@mailbox.org>
Cc: cgit@lists.zx2c4.com
Subject: Re: [PATCH] html: fix fmt() off-by-one error
Date: Tue, 8 Feb 2022 13:38:28 +0100	[thread overview]
Message-ID: <20220208133828.103214c7@leda.eworm.net> (raw)
In-Reply-To: <20220208113745.13748-1-lsof@mailbox.org>

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

lemon <lsof@mailbox.org> on Tue, 2022/02/08 12:37:
> vsnprintf returns the byte count of the formatted output not including
> the null terminator, so in the case that len == 1024 the last character
> of the output was being truncated and not detected by the later check.
> Changing the greater than comparison to greater than or equal fixes this
> edge case.

We already have that pending...
https://git.zx2c4.com/cgit/commit/?h=ch/html-fmt&id=d828a623442e3fc3159e2c188a78e6fd4aca8af4
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-02-08 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 11:37 lemon
2022-02-08 12:38 ` Christian Hesse [this message]
2022-02-08 12:39   ` Jason A. Donenfeld
2022-02-08 17:03     ` Christian Hesse

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=20220208133828.103214c7@leda.eworm.net \
    --to=list@eworm.de \
    --cc=cgit@lists.zx2c4.com \
    --cc=lsof@mailbox.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).