Обсуждение: Compiler warning about overflow in xlog.c

Поиск
Список
Период
Сортировка

Compiler warning about overflow in xlog.c

От
Petr Jelinek
Дата:
Hi,

my compiler complains about overflow in xlog.c.

There is variable defined as char partialfname[MAXFNAMELEN]; but is used
as snprintf(partialfname, MAXPGPATH, "%s.partial", origfname);

There is no practical issue as the actual filename length is never over
MAXFNAMELEN even with the .partial suffix but the code should still be
fixed which is what attached one-line patch does.

--
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services

Вложения

Re: Compiler warning about overflow in xlog.c

От
Tom Lane
Дата:
Petr Jelinek <petr@2ndquadrant.com> writes:
> my compiler complains about overflow in xlog.c.

Yeah, Peter E. reported this yesterday.  Since Heikki didn't do
anything about that yet, I pushed your fix.
        regards, tom lane