[PATCH] html: fix fmt() off-by-one error

Christian Hesse list at eworm.de
Tue Feb 8 12:38:28 UTC 2022


lemon <lsof at 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);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20220208/cfc60078/attachment.sig>


More information about the CGit mailing list