diff options
| author | Neil Conway <neilc@samurai.com> | 2005-05-26 02:04:14 +0000 |
|---|---|---|
| committer | Neil Conway <neilc@samurai.com> | 2005-05-26 02:04:14 +0000 |
| commit | 63e0d612f5a53d76218d4e59a35287391e284561 (patch) | |
| tree | 1acd1cc27ec9fd5855a6878f5f0d93f0683863e0 /src/test/regress/expected/interval.out | |
| parent | 15e4d1e2a7f565d805692daad895a07802279aea (diff) | |
| download | postgresql-63e0d612f5a53d76218d4e59a35287391e284561.tar.gz | |
Adjust datetime parsing to be more robust. We now pass the length of the
working buffer into ParseDateTime() and reject too-long input there,
rather than checking the length of the input string before calling
ParseDateTime(). The old method was bogus because ParseDateTime() can use
a variable amount of working space, depending on the content of the
input string (e.g. how many fields need to be NUL terminated). This fixes
a minor stack overrun -- I don't _think_ it's exploitable, although I
won't claim to be an expert.
Along the way, fix a bug reported by Mark Dilger: the working buffer
allocated by interval_in() was too short, which resulted in rejecting
some perfectly valid interval input values. I added a regression test for
this fix.
Diffstat (limited to 'src/test/regress/expected/interval.out')
| -rw-r--r-- | src/test/regress/expected/interval.out | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/regress/expected/interval.out b/src/test/regress/expected/interval.out index ab89b2232d..daa6348785 100644 --- a/src/test/regress/expected/interval.out +++ b/src/test/regress/expected/interval.out @@ -221,3 +221,10 @@ select avg(f1) from interval_tbl; @ 4 years 1 mon 10 days 4 hours 18 mins 23 secs (1 row) +-- test long interval input +select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval; + interval +-------------------------------------------- + @ 4541 years 4 mons 4 days 17 mins 31 secs +(1 row) + |
