[HACKERS] packetBuf size - Mailing list pgsql-hackers

From Igor
Subject [HACKERS] packetBuf size
Date
Msg-id ad179682f910035ea69a78053b6d54bd
Whole thread Raw
List pgsql-hackers
Does anyone have any idea why the DATA variable in
PacketBuf is this MESSAGE_SIZE size in libpq?
#define MESSAGE_SIZE  sizeof(StartupInfo)+5
                             ^^^
Bruce, I think you might have commented on this before..I am not sure.
The total amount of data written into that variable is
database (64 bytes), username (32 bytes), options (64), execfile(64),
tty (64)...total is 288 bytes (MESSAGE_SIZE is 293). The last 5 bytes are
never used. Purify reports an uninitialized memory read when the packetBuf
is passed into sendto() function. Removing the +5 from the definition of
MESSAGE_SIZE removes this error, and I haven't noticed any problems after
running regression tests...

Comments?

=+=------------------------/\---------------------------------=+=
       Igor Natanzon      |**|   E-mail: igor@sba.miami.edu
=+=------------------------\/---------------------------------=+=

------------------------------

pgsql-hackers by date:

Previous
From: David Friend
Date:
Subject: [HACKERS] Press release, second draft
Next
From: "Vadim B. Mikheev"
Date:
Subject: [HACKERS] Re: [PORTS] GEQO broken on 6-6-97?!?