Content-Length: 260683 | pFad | http://github.com/postgrespro/postgres_cluster/commit/4e46c97fde42fa8ca57d29b9b47f2ebd11ab8105

8E Fix NULL pointer dereference in tuplesort.c. · postgrespro/postgres_cluster@4e46c97 · GitHub
Skip to content

Commit 4e46c97

Browse files
committed
Fix NULL pointer dereference in tuplesort.c.
Oversight in commit e94568e. This could cause a crash when an external datum tuplesort of a pass-by-value type required multiple passes. Per report from Mithun Cy. Peter Geoghegan Discussion: https://postgr.es/m/CAD__OujuhfWFULGFSt1fyHqUb8N-XafjJhudwt88V0Qs2o84qg@mail.gmail.com
1 parent fcf7086 commit 4e46c97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/utils/sort/tuplesort.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,8 @@ mergeonerun(Tuplesortstate *state)
28002800
WRITETUP(state, destTape, &state->memtuples[0]);
28012801

28022802
/* recycle the slot of the tuple we just wrote out, for the next read */
2803-
RELEASE_SLAB_SLOT(state, state->memtuples[0].tuple);
2803+
if (state->memtuples[0].tuple)
2804+
RELEASE_SLAB_SLOT(state, state->memtuples[0].tuple);
28042805

28052806
/*
28062807
* pull next tuple from the tape, and replace the written-out tuple in

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/4e46c97fde42fa8ca57d29b9b47f2ebd11ab8105

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy