Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PARMCI_Wait either has unnecessary NULL checks or does UB #353

Open
jeffhammond opened this issue Sep 30, 2024 · 0 comments
Open

PARMCI_Wait either has unnecessary NULL checks or does UB #353

jeffhammond opened this issue Sep 30, 2024 · 0 comments
Labels

Comments

@jeffhammond
Copy link
Member

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){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant