mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Several calls to StrNCpy incorrectly subtracted 1 from the length arg,
leading to postmaster accepting args 1 shorter than it had room for.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.24 2000/01/26 05:56:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.25 2000/03/19 22:10:07 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -197,7 +197,7 @@ PacketSendError(Packet *pkt, char *errormsg)
|
||||
fprintf(stderr, "%s\n", errormsg);
|
||||
|
||||
pkt->pkt.em.data[0] = 'E';
|
||||
StrNCpy(&pkt->pkt.em.data[1], errormsg, sizeof(pkt->pkt.em.data) - 2);
|
||||
StrNCpy(&pkt->pkt.em.data[1], errormsg, sizeof(pkt->pkt.em.data) - 1);
|
||||
|
||||
/*
|
||||
* The NULL i/o callback will cause the connection to be broken when
|
||||
|
||||
Reference in New Issue
Block a user