From 71627f3d1964ef9831ea7997d2f4ac5617c718cc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 13 Feb 2013 16:20:01 -0500 Subject: 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. --- src/backend/utils/adt/enum.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/backend/utils/adt/enum.c') 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 */ -- cgit v1.2.3