Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4053189

Browse files
committed
Avoid potential buffer overflow crash
A pointer to a C string was treated as a pointer to a "name" datum andpassed to SPI_execute_plan(). This pointer would then end up beingpassed through datumCopy(), which would try to copy the entire 64 bytesof name data, thus running past the end of the C string. Fix byconverting the string to a proper name structure.Found by LLVM AddressSanitizer.
1 parentf19e92e commit4053189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ pg_get_viewdef_worker(Oid viewoid, int prettyFlags, int wrapColumn)
632632
* Get the pg_rewrite tuple for the view's SELECT rule
633633
*/
634634
args[0]=ObjectIdGetDatum(viewoid);
635-
args[1]=PointerGetDatum(ViewSelectRuleName);
635+
args[1]=DirectFunctionCall1(namein,CStringGetDatum(ViewSelectRuleName));
636636
nulls[0]=' ';
637637
nulls[1]=' ';
638638
spirc=SPI_execute_plan(plan_getviewrule,args,nulls, true,2);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp