File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 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 */
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 );
You can’t perform that action at this time.
0 commit comments