Skip to content

clip: fix wrong-type format arguments (CodeQL high-severity)#68

Merged
khosravipasha merged 1 commit into
prismfrom
fix/clip-qf-format-string
Jul 14, 2026
Merged

clip: fix wrong-type format arguments (CodeQL high-severity)#68
khosravipasha merged 1 commit into
prismfrom
fix/clip-qf-format-string

Conversation

@bri-prism

Copy link
Copy Markdown

What

Fixes the two cpp/wrong-type-format-argument defects CodeQL flags as high-severity in tools/mtmd/clip.cpp:

  1. The vision_feature_layer.size() != proj_spatial_offsets.size() error throw passed two size_t values to %d and had no argument for its leading %s (so the first size_t was formatted as the string). Now uses %zu for the sizes and passes __func__ for %s.
  2. The qwen-flamingo projector-block loop used size_t bid, passed to the %d in the TN_QF_* tensor-name format strings. Made bid an int so the format type matches (the tensor names are unchanged).

Why

CodeQL reported these as new high-severity alerts on prism, failing the CodeQL check. Both are genuine format/argument type mismatches (UB / garbage output), not false positives.

Test

mtmd target builds clean.

Two cpp/wrong-type-format-argument defects (high severity):
- the vision_feature_layer/proj_spatial_offsets size-mismatch throw passed
  size_t values to %d and had no argument for its leading %s; use %zu and
  pass __func__.
- the qwen-flamingo projector-block loop used size_t bid, passed to the %d in
  the TN_QF_* tensor-name formats; make bid int so the format type matches.
@github-actions github-actions Bot added the mtmd label Jul 14, 2026
@bri-prism bri-prism requested a review from khosravipasha July 14, 2026 05:15
@khosravipasha khosravipasha merged commit c0616d5 into prism Jul 14, 2026
14 of 28 checks passed
@khosravipasha khosravipasha deleted the fix/clip-qf-format-string branch July 14, 2026 05:30
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