Re: [HACKERS] Small timezone bug fixed

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jeroen van Vianen <jeroen(at)design(dot)nl>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Small timezone bug fixed
Date: 1999-12-09 05:02:13
Message-ID: 199912090502.AAA08173@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Applied.

> Hi,
>
> I was able to crash postgres 6.5.3 when I did an 'alter user' command.
> After I started a debugger I found the problem in the timezone handling of
> datetime (my Linux box lost its timezone information, that's how the
> problem occurred).
>
> Only 7 bytes are reserved for the timezone, without checking for boundaries.
>
> Attached is a patch that fixes this problem and emits a NOTICE if a
> timezone is encountered that is longer than MAXTZLEN bytes, like this:
>
> template1=# alter user postgres with password postgres;
> NOTICE: Invalid timezone 'Local time zone must be set--see zic manual page'
> NOTICE: Invalid timezone 'Local time zone must be set--see zic manual page'
> ALTER USER
>
> I don't know whether the timezone should be reset to some predefined
> constant (like "GMT") if an error like this occurs. This patch at least
> directs the user in a general direction that something is wrong with his setup.
>
> Cheers,
>
> Jeroen

[Attachment, skipping...]

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-12-09 06:20:48 Re: [HACKERS] pg_sorttemp hits 2GB during index construction
Previous Message Lamar Owen 1999-12-09 04:47:08 PostgreSQL front ends (was Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce))