mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Fix CVE-2013-0255 properly.
Revert commit ab0f7b6089
(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.
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user