Repository navigation
fix(image_analysis): prevent int overflow in YOLOv8 tensor size calculations (CodeQL #190) - #5872
Merged
Merged
Conversation
…lations (alert #190) Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
[WIP] Fix code scanning alert #190
fix(image_analysis): prevent int overflow in YOLOv8 tensor size calculations (CodeQL #190)
Aug 11, 2026
makr-code
marked this pull request as ready for review
August 11, 2026 14:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CodeQL alert #190 (
cpp/integer-multiplication-cast-to-long):input_height * input_width(bothint) was multiplied before implicit conversion tosize_type, risking overflow for non-default input dimensions.Changes
src/image_analysis/yolov8_onnx_plugin.cppstd::size_tbefore multiplication in three sites:tensor_out.resize(...)(line 237) — OpenCV pathc * H * W + y * W + x(line 241) — inner loop indexingtensor_out.assign(...)(line 253) — no-OpenCV fallback pathAt the default 640×640 resolution the product (~1.2 M) fits in
int, but larger custominput_width/input_heightconfigs (>~46 K in one dimension) would silently overflow. Fix is strictly narrower than the scope of the alert.Linked Issues
CodeQL alert: makr-code/ThemisDB #190
Type of Change
Breaking Change Checklist
VERSIONandCMakeLists.txtdocs/migration/### Removed/### Changedsection updatedTesting
Security Tiering Impact (Required for Runtime Changes)
Impacted tier(s):
Trust-boundary crossings documented in PR description (example: T3 -> T2, T5 -> T4 brokered call)
Boundary controls validated for affected T3/T4/T5 paths (AuthN/AuthZ, validation, rate limits, audit)
Boundary-focused tests added/updated or explicit N/A rationale provided
If trust level/privilege increased, security maintainer approval is attached
📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
AI-Generated Code (KI-generierter Code)
GetSymbolReferences_CppToolsgeprüft (siehe.github/instructions/cpp-language-service-tools.instructions.md)new/deleteohne explizites Review eingeführtAI Review Workflow (Required for AI-assisted PRs)
.github/prompts/pr-diff-findings-review.prompt.md.github/prompts/security-hardening-review.prompt.md(or N/A documented).github/prompts/api-change-impact-review.prompt.md(or N/A documented).github/copilot/REVIEW_SEVERITY_POLICY.mdHigh-Finding Exception Record (only if High is accepted)
High-finding exception claimed in this PR
Finding reference:
Maintainer approver:
Mitigation in current release:
Target fix milestone:
Tracking issue:
Validation evidence:
Release Readiness Gate (Required for release-scoped changes)
.github/prompts/release-readiness-check.prompt.mdfor branch transition scopeBRANCHING_STRATEGY.mdandRELEASE_STRATEGY.mdVERSIONING.mdandCHANGELOG.mdChecklist
[Unreleased]Scanner and IntelliSense Gates
criticalfindings in categoriessecurity,input_validation,query_correctness,distributed_consistency,concurrency,memoryhighfindings in the same categories (or explicitly approved)unknownscanner findings triaged (fixed, re-categorized, or justified)