Skip site navigation (1) Skip section navigation (2)

Re: BUG #1671: Long interval string representation rejected

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark Dilger <markdilger(at)yahoo(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1671: Long interval string representation rejected
Date: 2005-05-24 06:45:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Tom Lane wrote:
> I'm not set on it --- fix it as you suggested.

Attached is a patch that implements this. I'm not especially happy about 
the implementation: defining _two_ local macros (that both 
doubly-evaluate one of their arguments) is pretty ugly, but I didn't see 
a cleaner alternative -- suggestions welcome.

This patch fixes the stack overrun. Since we now pass the length of the 
working space into ParseDateTime(), it is also easy to fix Mark's bug: I 
just increased the size of the interval_in() working buffer to 256 
bytes. I didn't touch any of the other input buffer sizes, although that 
shouldn't be taken as a vote of confidence that they are correct :) At 
least the consequence of an insufficiently-large buffer is limited to 
rejecting otherwise valid input, rather than potentially scribbling on 
the stack.


Attachment: datetime_parsing-3.patch
Description: text/x-patch (19.5 KB)

In response to


pgsql-bugs by date

Next:From: Russell SmithDate: 2005-05-24 08:56:22
Subject: Re: BUG #1677: Bug in select with Union
Previous:From: Bruce MomjianDate: 2005-05-24 04:16:38
Subject: Re: [BUGS] BUG #1609: Bug in interval datatype for 64 Bit timestamps

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group