Skip to content

utils.cxx: Saftey improvements#36

Merged
scheibelp merged 1 commit into
spack:mainfrom
johnwparent:utils-safer-operations
May 20, 2026
Merged

utils.cxx: Saftey improvements#36
scheibelp merged 1 commit into
spack:mainfrom
johnwparent:utils-safer-operations

Conversation

@johnwparent
Copy link
Copy Markdown
Collaborator

Use dynamic arrays instead of c style arrays for better stack safety

Expand conditions for "invalid handles" on handle cleanup to avoid cleaning null handles

Add bounds checking for long paths, add error checking for sfn buffer size computation

Have debug flush the buffer immediately

Make strip paths behave consistently with caller expectations

Use dynamic arrays instead of c style arrays for better stack safety

Expand conditions for "invalid handles" on handle cleanup to avoid cleaning null handles

Add bounds checking for long paths, add error checking for sfn buffer size computation

Have debug flush the buffer immediately

Make strip paths behave consistently with caller expectations

Signed-off-by: John Parent <john.parent@kitware.com>
Comment thread src/utils.cxx
const std::string& old = old_new[0];
const std::string& new_ = old_new[1];
const std::string& old = strip_padding(old_new[0]);
const std::string& new_ = strip_padding(old_new[1]);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Follow up - determine if both of these need to be stripped

@scheibelp scheibelp merged commit eb48071 into spack:main May 20, 2026
1 check passed
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