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

Commitc3a1eae

Browse files
committed
Verify input in pg_read_file().
1 parent54b47c8 commitc3a1eae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Author: Andreas Pflug <pgadmin@pse-consulting.de>
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/genfile.c,v 1.22 2010/01/02 16:57:54 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/genfile.c,v 1.23 2010/01/05 01:29:36 itagaki Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -22,6 +22,7 @@
2222

2323
#include"catalog/pg_type.h"
2424
#include"funcapi.h"
25+
#include"mb/pg_wchar.h"
2526
#include"miscadmin.h"
2627
#include"postmaster/syslogger.h"
2728
#include"storage/fd.h"
@@ -131,6 +132,9 @@ pg_read_file(PG_FUNCTION_ARGS)
131132
(errcode_for_file_access(),
132133
errmsg("could not read file \"%s\": %m",filename)));
133134

135+
/* Make sure the input is valid */
136+
pg_verifymbstr(VARDATA(buf),nbytes, false);
137+
134138
SET_VARSIZE(buf,nbytes+VARHDRSZ);
135139

136140
FreeFile(file);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp