Skip to content

PARMCI_Wait either has unnecessary NULL checks or does UB #353

@jeffhammond

Description

@jeffhammond

The checks if (nb_handle) imply that this argument can be NULL. However, SAMECLUSNODE unconditionally dereferences this pointer, so it cannot be NULL.

This code should be cleaned up to do at most one NULL check on the argument. I might work on this at some point.

int PARMCI_Wait(armci_hdl_t* usr_hdl)
{
    armci_ihdl_t nb_handle = (armci_ihdl_t)usr_hdl;
    int success=0;
    int direct = SAMECLUSNODE(nb_handle->proc);

    if(direct) {
        return(success);
    }

    if(nb_handle) {
        if(nb_handle->agg_flag) {
            armci_agg_complete(nb_handle, UNSET);
            return (success);
        }
    }

    if(nb_handle){

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions