Skip to content

Possible NULL dereference with memcpy #381

@partimScurra

Description

@partimScurra

I stumbled across this issue with a static analyzer. If src is NULL, but srclen is not, there is no continue statement like in a preceding block:

tds_fdw/src/tds_fdw.c

Lines 1931 to 1936 in 8ac2e0b

else if (src == NULL)
{
ereport(DEBUG3,
(errmsg("tds_fdw: %s: Column value pointer is NULL, but probably shouldn't be", column->name)
));
}

This may create a possibility of executing memcpy with a NULL-pointer:

memcpy(VARDATA(bytes), src, srclen);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions