aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/enum.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-02-13 16:20:01 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2013-02-13 16:20:01 -0500
commit71627f3d1964ef9831ea7997d2f4ac5617c718cc (patch)
treea114bfdd27d8ec8484b570def5627f0a21522a80 /src/backend/utils/adt/enum.c
parent9728eda7925b6d42621b38c48e91ef9ab8d90cbc (diff)
downloadpostgresql-71627f3d1964ef9831ea7997d2f4ac5617c718cc.tar.gz
postgresql-71627f3d1964ef9831ea7997d2f4ac5617c718cc.zip
Fix CVE-2013-0255 properly.
Revert commit ab0f7b6089fd215f6ce6081e2e222c38d643a526 (in HEAD only) in favor of the proper solution, which is to declare enum_recv() correctly in the system catalogs. It should be declared to take type "internal" not "cstring". Also improve the type_sanity regression test, which should have caught this typo, so that it actually would. Most of the relevant checks on the signature of type I/O functions should not have been restricted to basetypes/pseudotypes, as they should apply to any type's I/O functions.
Diffstat (limited to 'src/backend/utils/adt/enum.c')
-rw-r--r--src/backend/utils/adt/enum.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/backend/utils/adt/enum.c b/src/backend/utils/adt/enum.c
index 1eb8ccfaee5..01a726be447 100644
--- a/src/backend/utils/adt/enum.c
+++ b/src/backend/utils/adt/enum.c
@@ -18,7 +18,6 @@
#include "access/htup_details.h"
#include "catalog/indexing.h"
#include "catalog/pg_enum.h"
-#include "catalog/pg_type.h"
#include "libpq/pqformat.h"
#include "utils/array.h"
#include "utils/builtins.h"
@@ -105,10 +104,6 @@ enum_recv(PG_FUNCTION_ARGS)
char *name;
int nbytes;
- /* guard against pre-9.3 misdeclaration of enum_recv */
- if (get_fn_expr_argtype(fcinfo->flinfo, 0) == CSTRINGOID)
- elog(ERROR, "invalid argument for enum_recv");
-
name = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
/* must check length to prevent Assert failure within SearchSysCache */