While debugging yet another overrun I came across the StrNCpy macro.
A quick grep of the source tells me that usage of the StrNCpy macro is
strptr = palloc(len); // done is a diffrent context
ptr = palloc(len + 1);
StrNCpy(ptr, strptr, len + 1);
StrNCpy(name.data, ptr2name, NAMEDATALEN);
The StrNCpy macro zero terminates the destination buffer.
Usage 1 is gives a read=buffer overrun (which I agree is not the most
serious of bugs
if you system doesn't dump core on it).
Usage 2 makes gives the name a maximum of 31 instead of 32 characters.
Is the maximun name length supposted to be 31 or 32 characters?
With regards from Maurice.
pgsql-hackers by date
|Next:||From: Boersenspielteam||Date: 1998-03-31 12:30:35|
|Subject: Re: [HACKERS] Reminder: Indices are not used|
|Previous:||From: Goran Thyni||Date: 1998-03-31 08:56:03|
|Subject: free-text searching|