Skip site navigation (1) Skip section navigation (2)

pgsql: Validate xlog record header before enlarging the work area tost

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Validate xlog record header before enlarging the work area tost
Date: 2012-06-30 20:14:42
Message-ID: E1Sl442-0002lj-Nf@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Validate xlog record header before enlarging the work area to store it.

If the record header is garbled, we're now quite likely to notice it before
we try to make a bogus memory allocation and run out of memory. That can
still happen, if the xlog record is split across pages (we cannot verify
the record header until reading the next page in that scenario), but this
reduces the chances. An out-of-memory is treated as a corrupt record
anyway, so this isn't a correctness issue, just a case of giving a better
error message.

Per Amit Kapila's suggestion.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/567787f216da750b3805aea6fd8aef19e8b882a1

Modified Files
--------------
src/backend/access/transam/xlog.c |   36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-06-30 20:43:49
Subject: pgsql: initdb: Update check_need_password for new options
Previous:From: Tom LaneDate: 2012-06-29 19:12:57
Subject: Re: pgsql: Dramatically reduce System V shared memory consumption.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group