Skip to content

NEGATIVE_CODE_ERROR.EX #641

Description

@kuznetsovvvv

errcontext("while scanning block %u offset %u of relation \"%s.%s\"",

I found potential vulnerability in code. In lines 3141,4144,3148,3156,3159,3163,3168,3173,3179. set_errcontext_domain can be -1 when calling the errcontext function, which results in the set_errcontext_domain function being executed, where the array address can be negative. The variable is checked after the address is accessed in the CHECK_STACK_DEPTH function, which can lead to undefined behavior or data corruption.

(errcode(ERRCODE_WRONG_OBJECT_TYPE),

I also found potential vulnerability related to the function errcode. In the errcode function being called, the value of the errordata_stack_depth variable is used for index access, but checking for a negative value in the CHECK_STACK_DEPTH(); function occurs after an access attempt, which may lead to undefined behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions