pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix misuse of TextDatumGetCString().
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix misuse of TextDatumGetCString().
@ 2015-07-02 21:02 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-07-02 21:02 UTC (permalink / raw)
  To: pgsql-committers

Fix misuse of TextDatumGetCString().

"TextDatumGetCString(PG_GETARG_TEXT_P(x))" is formally wrong: a text*
is not a Datum.  Although this coding will accidentally fail to fail on
all known platforms, it risks leaking memory if a detoast step is needed,
unlike "TextDatumGetCString(PG_GETARG_DATUM(x))" which is what's used
elsewhere.  Make pg_get_object_address() fall in line with other uses.

Noted while reviewing two-arg current_setting() patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ac50f84866b22f239025bf37c9c7492cc4ce2dfd

Modified Files
--------------
src/backend/catalog/objectaddress.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix misuse of TextDatumGetCString().
@ 2015-07-02 21:02 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-07-02 21:02 UTC (permalink / raw)
  To: pgsql-committers

Fix misuse of TextDatumGetCString().

"TextDatumGetCString(PG_GETARG_TEXT_P(x))" is formally wrong: a text*
is not a Datum.  Although this coding will accidentally fail to fail on
all known platforms, it risks leaking memory if a detoast step is needed,
unlike "TextDatumGetCString(PG_GETARG_DATUM(x))" which is what's used
elsewhere.  Make pg_get_object_address() fall in line with other uses.

Noted while reviewing two-arg current_setting() patch.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/69e9f9639d5c569a71c82f99550e7bf2912664f1

Modified Files
--------------
src/backend/catalog/objectaddress.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-07-02 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02 21:02 pgsql: Fix misuse of TextDatumGetCString(). Tom Lane <tgl@sss.pgh.pa.us>
2015-07-02 21:02 pgsql: Fix misuse of TextDatumGetCString(). Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox