Skip to content

Dereferences of NULL after checks #2664

@partimScurra

Description

@partimScurra

Describe the issue
A static analysis tool highlighted possible dereferences at following functions:

/keepalived/vrrp/vrrp.c, open_sockpool_socket:

  1. sock->mcast_daddr is used at 2800 after being checked at 2793;
  2. sock->ifp is used at 2794 after being checked before the open_sockpool_socket call at vrrp_scheduler.c:555

/lib/vector.c, strvec_slot:
strvec is passed into null_strvec_handler after being checked. The null_strvec function, that is used as null_strvec_handler, doesn't have additional check for strvec.

To Reproduce
Is a code-related issue.

Expected behavior
The NULL checks imply a possibility of NULL being accessed later in the code. Perhaps existing checks need to be revised to prevent such possibility.

Keepalived version
2.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions