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 2132305.1623452937@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>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> It might be worth doing something about this, for other reasons. We have
> disabled -Wstringop-truncation in 716585235b1. But I've enabled it in my
> debug build, because I find it useful.

ITYM e71658523 ?  I can't find that hash in my repo.  Anyway, I agree
that disabling that was a bit of a stopgap hack.  This 'nonstring'
attribute seems like it would help for ECPG's usage, at least.

> I've not looked at how much work it'd be to make a recent-ish gcc not to
> produce lots of false positives in optimized builds.

The discussion that led up to e71658523 seemed to conclude that the
only reasonable way to suppress the majority of those warnings was
to get rid of the fixed-length MAXPGPATH buffers we use everywhere.
Now that we have psprintf(), that might be more workable than before,
but the effort-to-reward ratio still doesn't seem promising.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] Fix buffer not null terminated on (ecpg lib)
Next
From: Justin Pryzby
Date:
Subject: Re: unnesting multirange data types