Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[valgrind] Invalid read in postquel_sub_params #270

Open
wants to merge 3 commits into
base: BABEL_3_X_DEV__PG_15_X
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/backend/executor/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,21 @@ postquel_sub_params(SQLFunctionCachePtr fcache,
* because of possible function inlining during planning.)
*/
prm->isnull = fcinfo->args[i].isnull;
prm->value = MakeExpandedObjectReadOnly(fcinfo->args[i].value,
if (i >= fcache->pinfo->nargs)
{
prm->value = MakeExpandedObjectReadOnly(fcinfo->args[i].value,
prm->isnull,
get_typlen(0));
prm->ptype = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ptype being zero doesn't seem right to me. Btw, this issue seem to be community PG issue, we should report it in the community and try to find the solution collectively.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with @Deepesh125 , @Suthapalli-Ramya-satya-vasavi-srija is there a way we can fix this on the extension? If not, then we may need to report it in the community.

@Deepesh125 more info in the Jira.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is an issue in engine code, we should not fix it in extension.

}
else
{
prm->value = MakeExpandedObjectReadOnly(fcinfo->args[i].value,
prm->isnull,
get_typlen(argtypes[i]));
prm->ptype = argtypes[i];
}
prm->pflags = 0;
prm->ptype = argtypes[i];
}
}
else
Expand Down
Loading