Skip to content

Fix parsing of envvars in MCA files #1374

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

Merged
merged 1 commit into from
Feb 18, 2016
Merged

Conversation

hjelmn
Copy link
Member

@hjelmn hjelmn commented Feb 17, 2016

This commit fixes a memory corruption bug when parsing lines of the
form:

-x FOO=bar

The code was making changes to the size of the buffer allocated for
key_buffer without making the appropriate changes to
key_buffer_len. This was causing subsequent calls to save_param_name
to write to invalid memory.

This commit makes the following changes:

  • Fix the above bug by modifying trim_name to move the string within
    the buffer instead of re-allocating space for the trimmed string.
  • Cleaned up both trim_name and save_param_name. Both functions took
    a prefix and suffix to trim. Problem was the prefix was not
    treated like a prefix. Instead the "prefix" was located inside the
    string using strstr then the trimmed value started after the
    substring (even in the middle of the string). To allow trimming
    both -x and --x (as well as -mca and --mca) trim_name is now
    called with each prefix.

Signed-off-by: Nathan Hjelm [email protected]

This commit fixes a memory corruption bug when parsing lines of the
form:

-x FOO=bar

The code was making changes to the size of the buffer allocated for
key_buffer without making the appropriate changes to
key_buffer_len. This was causing subsequent calls to save_param_name
to write to invalid memory.

This commit makes the following changes:

  - Fix the above bug by modifying trim_name to move the string within
    the buffer instead of re-allocating space for the trimmed string.

  - Cleaned up both trim_name and save_param_name. Both functions took
    a prefix and suffix to trim. Problem was the prefix was not
    treated like a prefix. Instead the "prefix" was located inside the
    string using strstr then the trimmed value started after the
    substring (even in the middle of the string). To allow trimming
    both -x and --x (as well as -mca and --mca) trim_name is now
    called with each prefix.

Signed-off-by: Nathan Hjelm <[email protected]>
@hjelmn hjelmn added the bug label Feb 17, 2016
@hjelmn hjelmn self-assigned this Feb 17, 2016
@hjelmn hjelmn added this to the v2.0.0 milestone Feb 17, 2016
@hjelmn
Copy link
Member Author

hjelmn commented Feb 17, 2016

:bot:retest:

Mellanox Jenkins died. Rerunning.

hjelmn added a commit that referenced this pull request Feb 18, 2016
Fix parsing of envvars in MCA files
@hjelmn hjelmn merged commit 92a15cc into open-mpi:master Feb 18, 2016
jsquyres pushed a commit to jsquyres/ompi that referenced this pull request Sep 19, 2016
…copy_fix_v1.10

v1.10: OSHMEM: spml ikrit: fixes zero copy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant