Re: [PATCH] Fix buffer not null terminated on (ecpg lib) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Fix buffer not null terminated on (ecpg lib)
Date
Msg-id 429384.1623779588@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Fix buffer not null terminated on (ecpg lib)  (Andres Freund <andres@anarazel.de>)
Responses Re: [PATCH] Fix buffer not null terminated on (ecpg lib)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2021-06-15 07:40:46 -0300, Ranier Vilela wrote:
>> memcpy would not suffer from it?

> It'd not be correct for short sqlstates - you'd read beyond the end of
> the source buffer. There are cases of it in the ecpg code.

What's a "short SQLSTATE"?  They're all five characters by definition.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: unnesting multirange data types
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: unnesting multirange data types