Skip to content

fix: the memcpy and memmove calls at lines 829-837 i... in main.c#20996

Merged
TurboGit merged 2 commits into
darktable-org:masterfrom
orbisai0security:fix-v001-heap-buffer-overflow-extra-patches
May 16, 2026
Merged

fix: the memcpy and memmove calls at lines 829-837 i... in main.c#20996
TurboGit merged 2 commits into
darktable-org:masterfrom
orbisai0security:fix-v001-heap-buffer-overflow-extra-patches

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

Summary

Fix critical severity security issue in src/chart/main.c.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File src/chart/main.c:829
CWE CWE-120

Description: The memcpy and memmove calls at lines 829-837 in src/chart/main.c do not validate that n_extra_patches or *N fit within the allocated destination buffers (target_L, target_a, target_b, colorchecker_Lab). An attacker who supplies a crafted color chart or calibration file encoding a large n_extra_patches value can cause a heap buffer overflow, overwriting heap metadata or adjacent allocations.

Changes

  • src/chart/main.c

Verification

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

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
Comment thread src/chart/main.c Outdated
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks!

@TurboGit TurboGit added this to the 5.6 milestone May 15, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug scope: codebase making darktable source code easier to manage labels May 15, 2026
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit TurboGit merged commit 3fc2dc3 into darktable-org:master May 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: codebase making darktable source code easier to manage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants