Compiler warning about overflow in xlog.c

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Compiler warning about overflow in xlog.c
Date: 2015-05-23 19:52:28
Message-ID: 5560DA7C.2030908@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
xlog-overflow-fix.diff binary/octet-stream 530 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2015-05-23 20:03:34 Re: jsonb_set: update or upsert default?
Previous Message Tom Lane 2015-05-23 19:35:21 Re: [COMMITTERS] pgsql: Allow GiST distance function to return merely a lower-bound.