fix coverity issue - CID 395489: Null pointer dereferences#8278
Merged
maxzhen merged 2 commits intoXilinx:masterfrom Jul 9, 2024
Merged
fix coverity issue - CID 395489: Null pointer dereferences#8278maxzhen merged 2 commits intoXilinx:masterfrom
maxzhen merged 2 commits intoXilinx:masterfrom
Conversation
Signed-off-by: Max Zhen <[email protected]>
stsoe
approved these changes
Jul 9, 2024
| @@ -1280,8 +1280,10 @@ patch(const xrt::module& module, uint8_t* ibuf, size_t* sz, const std::vector<st | |||
| } else if(hdl->get_os_abi() == Elf_Amd_Aie2ps) { | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| } else if(hdl->get_os_abi() == Elf_Amd_Aie2ps) { | |
| } | |
| else if (hdl->get_os_abi() == Elf_Amd_Aie2ps) { |
| throw std::runtime_error{"Only support patching single column"}; | ||
| throw std::runtime_error{"Patch failed: only support patching single column"}; | ||
| inst = &instr_buf[0]; | ||
| } else { |
Collaborator
There was a problem hiding this comment.
Suggested change
| } else { | |
| } | |
| else { |
Signed-off-by: Max Zhen <[email protected]>
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.
Problem solved by the commit
Fixing coverity issue: CID 395489: Null pointer dereferences (FORWARD_NULL)
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
Introduced by PR#8272
How problem was solved, alternative solutions (if any) and why they were rejected
Throw in case inst is nullptr, instead of dereferencing it.