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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy