Skip to content

fix: add integer overflow check in dxt_encoder.c#496

Open
orbisai0security wants to merge 1 commit into
CESNET:masterfrom
orbisai0security:fix-dxt-encoder-integer-overflow-v003
Open

fix: add integer overflow check in dxt_encoder.c#496
orbisai0security wants to merge 1 commit into
CESNET:masterfrom
orbisai0security:fix-dxt-encoder-integer-overflow-v003

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix critical severity security issue in dxt_compress/dxt_encoder.c.

Vulnerability

Field Value
ID V-003
Severity CRITICAL
Scanner multi_agent_ai
Rule V-003
File dxt_compress/dxt_encoder.c:679
Assessment Confirmed exploitable
CWE CWE-190

Description: The memcpy at line 679 copies compressed data into image_compressed using a complex size calculation with alignment rounding. The allocation at line 453 may use a different formula, creating a size mismatch. The arithmetic expression ((width+3)/44)((height+3)/4*4) is susceptible to integer overflow with large width/height values, potentially resulting in a small computed size that wraps around.

Changes

  • dxt_compress/dxt_encoder.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant