-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: main
Are you sure you want to change the base?
Conversation
Perhaps adding |
|
Good to know! |
" memcpy(&old, &str, sizeof(char*));\n" | ||
"}\n"); | ||
// TODO: make this fail | ||
ASSERT_EQUALS("", errout_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running cppcheck on this code on the command line (without any additional options) produces an error,but nothing happens in the test function.
What could the reason for this be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe std.cfg
is not loaded in that test, so strdup()
and memcpy()
are not recognized. There should be other tests where we load the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just matching the token with "memcpy"
though, is the library loading really required for that?
Edit: right, the strdup is crucial
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?