Re: [HACKERS] fatal copy in/out error (6.5.3)

From: Michael Robinson <robinson(at)netrinsics(dot)com>
To: robinson(at)netrinsics(dot)com, t-ishii(at)sra(dot)co(dot)jp
Cc: pgsql-hackers(at)hub(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: [HACKERS] fatal copy in/out error (6.5.3)
Date: 2000-01-25 06:05:36
Message-ID: 200001250605.OAA39630@netrinsics.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
>Yes, it's not a PostgreSQL's business but is a really big problem in
>the real world. Maybe some HTML gurus might have good suggestions on
>these issues (something like using a language tag?)

The only solution is defensive programming. Even if there were a standard
that everyone followed, if malicious people could break things by not
following the standard, then you can be certain that somebody would do so.

>Here it is. With this patch, copy out should be happy even with the
>wrong data. I'm not sure if it could be displayed correctly, though.

Thank you very much. However, I think even this is too optimistic:

>! if (*s & 0x80)

Shouldn't it be something like:

if ((*s & 0x80) && (*(s+1) & 0x80))

Even though "\242\242\242\0" is an invalid EUC sequence, it still shouldn't be
allowed to break the software.

-Michael Robinson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 2000-01-25 06:07:03 Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace
Previous Message Philip Warner 2000-01-25 06:00:26 Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace