Re: Possible memory corruption (src/timezone/zic.c b/src/timezone/zic.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible memory corruption (src/timezone/zic.c b/src/timezone/zic.c)
Date: 2021-05-15 14:35:13
Message-ID: CAEudQAqH7J8wSjSPwPx6_Pk4yyvF+NnHPagJqwZvpb7bqc3UEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em sex., 14 de mai. de 2021 às 19:52, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:

> I wrote:
> > So the question for us is whether it's worth trying to make pgreadlink
> > conform to the letter of the POSIX spec in this detail. TBH, I can't
> > get excited about that, at least not so far as zic's usage is concerned.
>
> Hmmm ... on closer inspection, though, it might not be that hard.
> pgreadlink is already using a fixed-length buffer (with only enough
> room for MAX_PATH WCHARs) for the input of WideCharToMultiByte. So
> it could use a fixed-length buffer of say 4 * MAX_PATH bytes for the
> output, and then transfer just the appropriate amount of data to the
> caller's buffer.
>
Following your directions, maybe something like this will solve?

regards,
Ranier Vilela

Attachment Content-Type Size
v2_fix_possible_memory_corruption_zic.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-05-15 16:00:37 Re: amvalidate(): cache lookup failed for operator class 123
Previous Message Ajin Cherian 2021-05-15 14:07:02 Re: [HACKERS] logical decoding of two-phase transactions