BUG #18867: /src/interfaces/ecpg/preproc/descriptor.c usage of ECPGdump_a_type

Started by PG Bug reporting formabout 1 year ago1 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 18867
Logged by: Daniel Elishakov
Email address: dan-eli@mail.ru
PostgreSQL version: 17.4
Operating system: ubuntu 20.04
Description:

After having been assigned to a NULL value at descriptor.c:203 and
descriptor.c:313, pointer '0' is passed as 5th parameter in call to function
'ECPGdump_a_type', where it is dereferenced at type.c:332.
if (indicator_set && ind_type->type != ECPGt_struct)
mmfatal(INDICATOR_NOT_STRUCT, "indicator for struct has to be a
struct");
It seems that a struct data type should not be used in 'EXEC SQL GET
DESCRIPTOR' command, so the code in question should never be executed and it
is not a problem. However there are no actual checks for corrrectess of the
provided data type. I think it is required to add a check agains wrong data
types supplied by the user.