Skip to content

Conversation

@jsquyres
Copy link
Member

Signed-off-by: Jeff Squyres jsquyres@cisco.com

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
@jsquyres jsquyres merged commit 582b69b into open-mpi:master Sep 26, 2018
@jsquyres jsquyres deleted the pr/warnings-fixes branch September 26, 2018 20:46
if (orte_get_attribute(&proc->attributes, ORTE_PROC_HWLOC_BOUND, (void**)&bd, OPAL_PTR)) {
if (NULL == bd) {
(void)strncpy(tmp1, "UNBOUND", strlen("UNBOUND"));
(void)strncpy(tmp1, "UNBOUND", sizeof(tmp1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this PR is closed, but you're asking me to review the PRs into release branches. This patch isn't really any better. strncpy() is not guaranteed to NULL terminate the string, so this can still cause memory corruption down stream. Better would be to explicitly set tmp1[sizeof(tmp1) - 1] = '\0'; after the strncpy() to make sure the string is NULL terminated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fixed in #5786.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants