Skip to content

fix: add bounds check before memcpy in mango.c#947

Open
orbisai0security wants to merge 1 commit into
mangowm:mainfrom
orbisai0security:fix-v001-border-color-memcpy-bounds
Open

fix: add bounds check before memcpy in mango.c#947
orbisai0security wants to merge 1 commit into
mangowm:mainfrom
orbisai0security:fix-v001-border-color-memcpy-bounds

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix critical severity security issue in src/mango.c.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File src/mango.c:4359

Description: Ten memcpy calls across src/mango.c (lines 4359, 4361, 5059) and src/animation/client.h (lines 1312, 1316, 1333, 1339, 1378, 1422, 1428) copy border color values into fixed-size fields within the opacity_animation struct without validating that the source buffer size matches the destination field size. If the source buffer is larger than the destination field, adjacent heap memory — including struct members or heap allocator metadata — can be silently overwritten.

Changes

  • src/mango.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
@DreamMaoMao DreamMaoMao force-pushed the main branch 2 times, most recently from c009ba2 to f328c27 Compare May 20, 2026 05:07
@DreamMaoMao DreamMaoMao force-pushed the main branch 5 times, most recently from 7faf9b6 to 36398a1 Compare June 8, 2026 15:30
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