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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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)

Browse pgsql-committers by date

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