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

fix #11542: FP memleak when using memcpy() with pointer #6792

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ludviggunne
Copy link
Contributor

Work in progress.

Just wanted to check if I'm heading in the right direction and using the
internal API correctly.

Is there a way to check if a variable is a pointer to a pointer?

@ludviggunne
Copy link
Contributor Author

Perhaps adding Variable::getIndirectionLevel() would be useful? Shouldn't be too hard to implement.

@chrchr-github
Copy link
Collaborator

var->valueType()->pointer should be 2 in this case.

@ludviggunne
Copy link
Contributor Author

var->valueType()->pointer should be 2 in this case.

Good to know!

test/testleakautovar.cpp Outdated Show resolved Hide resolved
lib/checkleakautovar.cpp Outdated Show resolved Hide resolved
lib/checkleakautovar.cpp Outdated Show resolved Hide resolved
@ludviggunne ludviggunne marked this pull request as ready for review October 22, 2024 09:21
@@ -633,6 +636,24 @@ class TestLeakAutoVar : public TestFixture {
ASSERT_EQUALS("", errout_str());
}

void memcpy1() { // #11542
const Settings s = settingsBuilder().library("std.cfg").library("posix.cfg").build();
Copy link
Owner

Choose a reason for hiding this comment

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

I think you don't need library("posix")

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.

3 participants