pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid dereferencing an undefined pointer in DecodeInterval(). 2+ messages / 1 participants [nested] [flat]
* pgsql: Avoid dereferencing an undefined pointer in DecodeInterval(). @ 2023-02-12 17:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2023-02-12 17:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid dereferencing an undefined pointer in DecodeInterval(). Commit e39f99046 moved some code up closer to the start of DecodeInterval(), without noticing that it had been implicitly relying on previous checks to reject the case of empty input. Given empty input, we'd now dereference a pointer that hadn't been set, possibly leading to a core dump. (But if we fail to provoke a SIGSEGV, nothing bad happens, and the expected syntax error is thrown a bit later.) Per bug #17788 from Alexander Lakhin. Back-patch to v15 where the fault was introduced. Discussion: https://postgr.es/m/17788-dabac9f98f7eafd5@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/5e80d3515488a12f776ba14a07fbb5aa6b3ef013 Modified Files -------------- src/backend/utils/adt/datetime.c | 2 +- src/test/regress/expected/interval.out | 5 +++++ src/test/regress/sql/interval.sql | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Avoid dereferencing an undefined pointer in DecodeInterval(). @ 2023-02-12 17:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2023-02-12 17:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid dereferencing an undefined pointer in DecodeInterval(). Commit e39f99046 moved some code up closer to the start of DecodeInterval(), without noticing that it had been implicitly relying on previous checks to reject the case of empty input. Given empty input, we'd now dereference a pointer that hadn't been set, possibly leading to a core dump. (But if we fail to provoke a SIGSEGV, nothing bad happens, and the expected syntax error is thrown a bit later.) Per bug #17788 from Alexander Lakhin. Back-patch to v15 where the fault was introduced. Discussion: https://postgr.es/m/17788-dabac9f98f7eafd5@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0ef65d0f55e5cec81fe98aba7c907dfc1b93923f Modified Files -------------- src/backend/utils/adt/datetime.c | 2 +- src/test/regress/expected/interval.out | 5 +++++ src/test/regress/sql/interval.sql | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-02-12 17:51 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-02-12 17:51 pgsql: Avoid dereferencing an undefined pointer in DecodeInterval(). Tom Lane <tgl@sss.pgh.pa.us> 2023-02-12 17:51 pgsql: Avoid dereferencing an undefined pointer in DecodeInterval(). 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