Skip to content

OPAL: fix string buffer allocation for large env variables [4.0.x] #8156

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

Conversation

devreal
Copy link
Contributor

@devreal devreal commented Oct 30, 2020

In OPAL's keyval parser in add_to_env_str, for the first variable a buffer of size 1024 was allocated, regardless of the space needed. For any additional variables, the size might have been doubled at best, even if more space was required. This PR makes sure the allocated buffer is sufficiently large to store the value.

Cherry-pick of #8144 to v4.0.x release branch.

Fixes #8117

Signed-off-by: Joseph Schuchart schuchart@icl.utk.edu

Also included cherry pick of #8163 (some coverity fixes that we found after we merged to master)

@jsquyres
Copy link
Member

NOTE: This is not yet merged on master. Only merge this PR after #8144 is merged.

Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
(cherry picked from commit 320a9a1)
@devreal devreal force-pushed the fix_opal_add_to_env_str_alloc_v4.0.x branch from 16260a1 to e39d1f3 Compare October 30, 2020 15:00
@devreal
Copy link
Contributor Author

devreal commented Oct 30, 2020

Updated with latest change from #8144

@jsquyres jsquyres modified the milestones: v4.1.0, v4.0.6 Oct 30, 2020
Coverity complained about uninitialized variables; ensure that they
are initialized to 0 in all cases.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
(cherry picked from commit eac0ab5)
Slightly improve comments and update some whitespace.

No code or logic changes.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
(cherry picked from commit 8ed1d28)
@jsquyres
Copy link
Member

Added commits from #8163 to this PR (i.e., cherry picked the Coverity fixes that were found after we merged to master).

@gpaulsen gpaulsen added the NEWS label Nov 4, 2020
@gpaulsen gpaulsen merged commit c43aa19 into open-mpi:v4.0.x Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants