fix: at qdl in qdl.c#241
Open
orbisai0security wants to merge 1 commit into
Open
Conversation
Contributor
|
Thank you for the bug fix. Please tell your AI to write a commit message that matches the style of the project. Then please tell a human to review and add the required signed-off-by. |
malloc() can return NULL when allocation fails, but the return value was not checked before passing the pointer to memcpy(). This causes a null pointer dereference if the system is out of memory or if filesize is zero. Add the missing NULL check and jump to the existing err label, which already handles cleanup of previously allocated images and blob->ptr. Signed-off-by: OrbisAI Security <mediratta01.pally@gmail.com>
7516e6b to
c82c207
Compare
Author
Acked. Pls review again. |
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.
Summary
Fix critical severity security issue in
qdl.c.Vulnerability
V-001qdl.c:253Description: At qdl.c:253, memory is allocated with malloc(filesize) and immediately used in memcpy(images[id].ptr, ptr, filesize) at qdl.c:254. There is no check that malloc succeeded before the memcpy, and no validation that filesize accurately reflects the actual size of the source buffer pointed to by ptr. If filesize is derived from attacker-controlled firmware image header fields, a crafted value can cause the memcpy to read beyond the source buffer or, if combined with integer overflow, write into an undersized heap allocation.
Changes
qdl.cVerification
Automated security fix by OrbisAI Security