Skip site navigation (1) Skip section navigation (2)

pgsql: Use StrNCpy not strncpy to fill hash key, to ensure the resulting

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use StrNCpy not strncpy to fill hash key, to ensure the resulting
Date: 2004-12-03 21:26:36
Message-ID: 20041203212636.668413A58DD@svr1.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Use StrNCpy not strncpy to fill hash key, to ensure the resulting key
is null-terminated.  I think this is not a real bug because the parser
would always have truncated the identifier to NAMEDATALEN-1 already,
but let's be safe.  Per report from Klocwork.

Modified Files:
--------------
    pgsql/src/backend/commands:
        prepare.c (r1.33 -> r1.34)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c.diff?r1=1.33&r2=1.34)

pgsql-committers by date

Next:From: Tom LaneDate: 2004-12-03 21:27:01
Subject: pgsql: Use StrNCpy not strncpy to fill hash key, to ensure the resulting
Previous:From: Peter EisentrautDate: 2004-12-03 19:52:12
Subject: pgsql: Translation fix by Julien Cristau

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group