On Fri, 18 Oct 2024 at 12:06, Hartmut Henkel via luatex <[email protected]> wrote:
> Hi Luigi, > > On Fri, 18 Oct 2024, luigi scarso wrote: > > On Thu, 17 Oct 2024 at 18:06, user202729--- via luatex <[email protected]> > wrote: > > b/source/texk/web2c/luatexdir/tex/printing.c > > index 8a52700..8ae11b4 100644 > > --- a/source/texk/web2c/luatexdir/tex/printing.c > > +++ b/source/texk/web2c/luatexdir/tex/printing.c > > @@ -482,7 +482,8 @@ void tprint(const char *sss) > > } > > /*tex What is left is the 3 term/log settings. */ > > if (dolog || doterm) { > > - buffer = xmalloc(strlen(sss)*3); > > + size_t len = strlen(sss); > > + buffer = xmalloc(len*3); > > only looking here by accident, but google tells that UTF-8 is 1 to 4 > bytes. So is "len*3" safe? > Indeed this is (one of the) issue(s) because that part is a mix of the traditional no-UNICODE (pdf)TeX and luatex, that manages UTF-8. The |pseudo| buffer for |show_contex| is a bit complicated. -- luigi
