Skip to content

[opencv] Fix core_fuzzer: catch exception by reference instead of by value#15263

Open
OwenSanzas wants to merge 1 commit intogoogle:masterfrom
OwenSanzas:fix-opencv-core-fuzzer
Open

[opencv] Fix core_fuzzer: catch exception by reference instead of by value#15263
OwenSanzas wants to merge 1 commit intogoogle:masterfrom
OwenSanzas:fix-opencv-core-fuzzer

Conversation

@OwenSanzas
Copy link
Copy Markdown
Contributor

Summary

All catch blocks use catch (cv::Exception e) (catch by value) instead of catch (cv::Exception& e) (catch by reference). Catching by value copies the exception object, which is unnecessary and can slice derived exception types.

Fix: Change all catch (cv::Exception e) to catch (cv::Exception& e).

Coverage comparison (60 seconds, empty seed corpus, ASan, libFuzzer)

Metric Original Fixed Change
Edge coverage 2536 2646 +4.34% (+110 edges)
Feature coverage 6893 7318 +6.17% (+425 features)

Note: The coverage improvement may be due to fuzzer randomness, but confirms the fix does not regress coverage.

@github-actions
Copy link
Copy Markdown

OwenSanzas has previously contributed to projects/opencv. The previous PR was #15092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant