Skip to content

Commit 4ecd197

Browse files
committed
Check that result tupdesc has exactly 1 column in return_next scalar case.
This should always be true, but since we're relying on a tuple descriptor passed from outside pltcl itself, let's check. Per a gripe from Coverity.
1 parent b40b4dd commit 4ecd197

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pl/tcl/pltcl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,10 @@ pltcl_returnnext(ClientData cdata, Tcl_Interp *interp,
21922192
Datum retval;
21932193
bool isNull = false;
21942194

2195+
/* for paranoia's sake, check that tupdesc has exactly one column */
2196+
if (call_state->ret_tupdesc->natts != 1)
2197+
elog(ERROR, "wrong result type supplied in return_next");
2198+
21952199
retval = InputFunctionCall(&prodesc->result_in_func,
21962200
utf_u2e((char *) Tcl_GetString(objv[1])),
21972201
prodesc->result_typioparam,

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