[HACKERS] packetBuf size - Mailing list pgsql-hackers

From Igor
Subject [HACKERS] packetBuf size
Date
Msg-id 9bcc51ff96aafeaa69bea97bdd525f9e
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: Bruce Momjian
Date:
Subject: [HACKERS] Re: ToDo list
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] packetBuf size