Skip to content

C++: Model taint flow through std::string constructor and c_str() #3195

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
merged 8 commits into from
Apr 3, 2020

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Apr 2, 2020

This is a very incomplete model of std::string, based on #1637 but a less ambitious starting point. I have put in the tests for operator<< as well but it's not yet modeled.

Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM!

/**
* The `std::basic_string` constructor(s).
*/
class StringConstructor extends TaintFunction {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the term "string" means so many different things in C/C++, I'd prefer more precise names for this file and its classes: StdString.qll, StdStringConstructor, StdStringCStr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

@jbj jbj merged commit 16c7a35 into github:master Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants