pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix corner case bug in numeric to_char().
12+ messages / 1 participants
[nested] [flat]

* pgsql: Fix corner case bug in numeric to_char().
@ 2011-09-07 21:07  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

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

Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/formatting.c    |   27 ++++++++++++++++++++-------
src/test/regress/expected/numeric.out |   18 ++++++++++++++++++
src/test/regress/sql/numeric.sql      |    4 ++++
3 files changed, 42 insertions(+), 7 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char().
@ 2011-09-07 21:07  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

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

Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2ab199b354135f199a895c4ee61c521b03a4d321

Modified Files
--------------
src/backend/utils/adt/formatting.c    |   27 ++++++++++++++++++++-------
src/test/regress/expected/numeric.out |   18 ++++++++++++++++++
src/test/regress/sql/numeric.sql      |    4 ++++
3 files changed, 42 insertions(+), 7 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char().
@ 2011-09-07 21:07  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

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

Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5df20a6e4f5eee5eef1b28760ceca604f57d535b

Modified Files
--------------
src/backend/utils/adt/formatting.c    |   27 ++++++++++++++++++++-------
src/test/regress/expected/numeric.out |   18 ++++++++++++++++++
src/test/regress/sql/numeric.sql      |    4 ++++
3 files changed, 42 insertions(+), 7 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char().
@ 2011-09-07 21:07  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

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

Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.

Branch
------
REL8_2_STABLE

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

Modified Files
--------------
src/backend/utils/adt/formatting.c    |   27 ++++++++++++++++++++-------
src/test/regress/expected/numeric.out |   18 ++++++++++++++++++
src/test/regress/sql/numeric.sql      |    4 ++++
3 files changed, 42 insertions(+), 7 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char().
@ 2011-09-07 21:07  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

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

Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.

Branch
------
REL8_3_STABLE

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

Modified Files
--------------
src/backend/utils/adt/formatting.c    |   27 ++++++++++++++++++++-------
src/test/regress/expected/numeric.out |   18 ++++++++++++++++++
src/test/regress/sql/numeric.sql      |    4 ++++
3 files changed, 42 insertions(+), 7 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char().
@ 2011-09-07 21:07  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

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

Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6e7a3c364bf5df266bb7000ead399e779410962c

Modified Files
--------------
src/backend/utils/adt/formatting.c    |   27 ++++++++++++++++++++-------
src/test/regress/expected/numeric.out |   18 ++++++++++++++++++
src/test/regress/sql/numeric.sql      |    4 ++++
3 files changed, 42 insertions(+), 7 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char() some more.
@ 2023-03-14 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2023-03-14 23:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case bug in numeric to_char() some more.

The band-aid applied in commit f0bedf3e4 turns out to still need
some work: it made sure we didn't set Np->last_relevant too small
(to the left of the decimal point), but it didn't prevent setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I don't see any hazard of interesting memory disclosure.

Per bug #17839 from Thiago Nunes.  The bug's pretty ancient,
so back-patch to all supported versions.

Discussion: https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/386a26023afb624726fb756ffdbef5b5832caa96

Modified Files
--------------
src/backend/utils/adt/formatting.c    | 11 +++++++++--
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  1 +
3 files changed, 16 insertions(+), 2 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char() some more.
@ 2023-03-14 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2023-03-14 23:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case bug in numeric to_char() some more.

The band-aid applied in commit f0bedf3e4 turns out to still need
some work: it made sure we didn't set Np->last_relevant too small
(to the left of the decimal point), but it didn't prevent setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I don't see any hazard of interesting memory disclosure.

Per bug #17839 from Thiago Nunes.  The bug's pretty ancient,
so back-patch to all supported versions.

Discussion: https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7cac191057ea8d6f2358f0504039d29e6c5e2141

Modified Files
--------------
src/backend/utils/adt/formatting.c    | 11 +++++++++--
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  1 +
3 files changed, 16 insertions(+), 2 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char() some more.
@ 2023-03-14 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2023-03-14 23:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case bug in numeric to_char() some more.

The band-aid applied in commit f0bedf3e4 turns out to still need
some work: it made sure we didn't set Np->last_relevant too small
(to the left of the decimal point), but it didn't prevent setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I don't see any hazard of interesting memory disclosure.

Per bug #17839 from Thiago Nunes.  The bug's pretty ancient,
so back-patch to all supported versions.

Discussion: https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6d3a9a60f78557dc6ab170db074f9e74da539d93

Modified Files
--------------
src/backend/utils/adt/formatting.c    | 11 +++++++++--
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  1 +
3 files changed, 16 insertions(+), 2 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char() some more.
@ 2023-03-14 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2023-03-14 23:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case bug in numeric to_char() some more.

The band-aid applied in commit f0bedf3e4 turns out to still need
some work: it made sure we didn't set Np->last_relevant too small
(to the left of the decimal point), but it didn't prevent setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I don't see any hazard of interesting memory disclosure.

Per bug #17839 from Thiago Nunes.  The bug's pretty ancient,
so back-patch to all supported versions.

Discussion: https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8e33fb9ef1df7f1a1e7ef2fe0dbddfff2520f161

Modified Files
--------------
src/backend/utils/adt/formatting.c    | 11 +++++++++--
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  1 +
3 files changed, 16 insertions(+), 2 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char() some more.
@ 2023-03-14 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2023-03-14 23:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case bug in numeric to_char() some more.

The band-aid applied in commit f0bedf3e4 turns out to still need
some work: it made sure we didn't set Np->last_relevant too small
(to the left of the decimal point), but it didn't prevent setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I don't see any hazard of interesting memory disclosure.

Per bug #17839 from Thiago Nunes.  The bug's pretty ancient,
so back-patch to all supported versions.

Discussion: https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b081fe4199b69dc561f7d31c6a82b3ad996f657f

Modified Files
--------------
src/backend/utils/adt/formatting.c    | 11 +++++++++--
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  1 +
3 files changed, 16 insertions(+), 2 deletions(-)



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

* pgsql: Fix corner case bug in numeric to_char() some more.
@ 2023-03-14 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2023-03-14 23:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix corner case bug in numeric to_char() some more.

The band-aid applied in commit f0bedf3e4 turns out to still need
some work: it made sure we didn't set Np->last_relevant too small
(to the left of the decimal point), but it didn't prevent setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I don't see any hazard of interesting memory disclosure.

Per bug #17839 from Thiago Nunes.  The bug's pretty ancient,
so back-patch to all supported versions.

Discussion: https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a67c75f8258742945f4f3703126a1222adeeb85b

Modified Files
--------------
src/backend/utils/adt/formatting.c    | 11 +++++++++--
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  1 +
3 files changed, 16 insertions(+), 2 deletions(-)



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


end of thread, other threads:[~2023-03-14 23:17 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-07 21:07 pgsql: Fix corner case bug in numeric to_char(). Tom Lane <tgl@sss.pgh.pa.us>
2011-09-07 21:07 pgsql: Fix corner case bug in numeric to_char(). Tom Lane <tgl@sss.pgh.pa.us>
2011-09-07 21:07 pgsql: Fix corner case bug in numeric to_char(). Tom Lane <tgl@sss.pgh.pa.us>
2011-09-07 21:07 pgsql: Fix corner case bug in numeric to_char(). Tom Lane <tgl@sss.pgh.pa.us>
2011-09-07 21:07 pgsql: Fix corner case bug in numeric to_char(). Tom Lane <tgl@sss.pgh.pa.us>
2011-09-07 21:07 pgsql: Fix corner case bug in numeric to_char(). Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 23:17 pgsql: Fix corner case bug in numeric to_char() some more. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 23:17 pgsql: Fix corner case bug in numeric to_char() some more. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 23:17 pgsql: Fix corner case bug in numeric to_char() some more. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 23:17 pgsql: Fix corner case bug in numeric to_char() some more. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 23:17 pgsql: Fix corner case bug in numeric to_char() some more. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 23:17 pgsql: Fix corner case bug in numeric to_char() some more. 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