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

segfault in pdsh-2.29 read_wcoll() when file == NULL #68

Open
GoogleCodeExporter opened this issue May 11, 2015 · 0 comments
Open

segfault in pdsh-2.29 read_wcoll() when file == NULL #68

GoogleCodeExporter opened this issue May 11, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The read_wcoll() function says that it permits either of its two parameters to 
be NULL :

/*
 * Read wcoll from specified file or from the specified FILE pointer.
 * (one of the arguments must be NULL).  
 *      file (IN)       name of wcoll file (or NULL)
 *      f (IN)          FILE pointer to wcoll file (or NULL)    
 *      RETURN          new list containing hostnames
 */

but it seems as if this function was not tested with a NULL `file` parameter 
after this strcmp() was added :

    if (strcmp (file, "-") == 0) {
        f = stdin;
        file = NULL;
    }

so effectively read_wcoll() will never permit the `file` (filename) parameter 
to be NULL, because it will crash in strcmp().

I have attached a patch.

Original issue reported on code.google.com by [email protected] on 26 Nov 2014 at 7:07

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant