Re: strncpy is not a safe version of strcpy

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: strncpy is not a safe version of strcpy
Date: 2014-08-14 06:50:02
Message-ID: 26688.1407999002@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)com> writes:
> On Wed, Aug 13, 2014 at 10:21:50AM -0400, Tom Lane wrote:
>> I believe that we deal with this by the expedient of checking the lengths
>> of tablespace paths in advance, when the tablespace is created.

> The files under scrutiny here are not located in a tablespace. Even if they
> were, isn't the length of $PGDATA/pg_tblspc the important factor?

The length of $PGDATA is of no relevance whatsoever; we chdir into that
directory at startup, and subsequently all paths are implicitly relative
to there. If there is any backend code that's prepending $PGDATA to
something else, it's wrong to start with.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-08-14 06:59:57 Re: Improvement of versioning on Windows, take two
Previous Message MauMau 2014-08-14 04:52:37 Re: [patch] pg_copy - a command for reliable WAL archiving