[pdftex] compiling 1.30.6 on openbsd-current

gnwiii at gmail.com gnwiii at gmail.com
Tue Mar 7 15:26:25 CET 2006


On 3/6/06, holop ferenc <fred at pentacom.sk> wrote:
> hi there,
>
> here are some of the warnings i got when compiling pdftex-1.30.6.
> these are only warnings, and i am writing only to let you know about
> them....
> [...]
>
> pdftexdir/libpdf.a(utils.o)(.text+0x55f): In function `pdf_printf':
> ../../../../src/texk/web2c/pdftexdir/utils.c:157: warning: vsprintf() is often
> misused, please use vsnprintf()

Pdftex is now being used 'invisibly' in production environments and no
doubt web services for things like cropping pdf images/figures (and by
people who have never heard of TeX), so some people building/using
pdfTeX need to be more careful about buffer overflows, etc.

In version 1.40 beta you can avoid these warnings if you use a c99
compiler (e.g., gcc -std=c99 ...).  For example, 
web2c/pdftexdir/utils.c was changed
to use vnsprintf if the  __STDC_VERSION__ >=199901L:

void pdf_printf (const char *fmt, ...)
{
    va_list args;
    va_start (args, fmt);
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >=199901L
    vsnprintf (print_buf, PRINTF_BUF_SIZE,
#else
    vsprintf (print_buf,
#endif
              fmt, args);
    pdf_puts (print_buf);
    va_end (args);
}


--
George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia



More information about the pdftex mailing list