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

Quadratic loop in PentaxMakerNote::printVersion #1909

Closed
kevinbackhouse opened this issue Sep 17, 2021 · 0 comments · Fixed by #1910
Closed

Quadratic loop in PentaxMakerNote::printVersion #1909

kevinbackhouse opened this issue Sep 17, 2021 · 0 comments · Fixed by #1910
Assignees
Labels
bug OSS-Fuzz Bug reported by https://google.github.io/oss-fuzz/
Milestone

Comments

@kevinbackhouse
Copy link
Collaborator

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38887

The loop in printVersion is quadratic, because it keeps searching from the start of the string:

while ((i = val.find(' ')) != std::string::npos && i != val.length() - 1) {
    val.replace(i, 1, ".");
}

poc: poc.tar.gz

@kevinbackhouse kevinbackhouse self-assigned this Sep 17, 2021
@kevinbackhouse kevinbackhouse added bug OSS-Fuzz Bug reported by https://google.github.io/oss-fuzz/ labels Sep 17, 2021
@kevinbackhouse kevinbackhouse added this to the v1.00 milestone Sep 17, 2021
@kevinbackhouse kevinbackhouse modified the milestones: v1.00, v0.27.5 Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OSS-Fuzz Bug reported by https://google.github.io/oss-fuzz/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant