For linux msm/device programmer selection test#206
Open
andersson wants to merge 2 commits intolinux-msm:masterfrom
Open
For linux msm/device programmer selection test#206andersson wants to merge 2 commits intolinux-msm:masterfrom
andersson wants to merge 2 commits intolinux-msm:masterfrom
Conversation
An empty image_path in a Sahara configuration file results in a NULL pointer dereference, guard against this to provide a more helpful outcome. Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
What used to be a simple process of picking the one file has now become a complicated machinery. Introduce a test suite to ensure the various cases remain functional. Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
igoropaniuk
reviewed
Apr 2, 2026
| # | ||
| # Clean up | ||
| # | ||
| rm -f 13a:prog_A.elf \ |
Contributor
There was a problem hiding this comment.
The file created before is (seems a type, 13a:14prog_A.elf):
cp prog_firehose_ddr.elf 13a:14prog_A.elf || true| mk_fixture_sahara "sahara-windows.xml" "13:c:\\prog_D.elf" | ||
| mk_fixture_sahara "sahara-non-exist.xml" "999:nonexisting-programmer.elf" | ||
| mk_fixture_sahara "sahara-empty-path.xml" "13:" | ||
| mk_fixture_sahara "sahara-absolute-path.xml" "13:$(readlink -f prog_A.elf)" |
Contributor
There was a problem hiding this comment.
This fixture is created and cleaned up, but seems there's no assert_programmer call for it.
| echo "Expected:" | ||
| echo "$expected" | ||
| echo "Got:" | ||
| #echo "$out" |
Contributor
There was a problem hiding this comment.
can we echo this conditionally based on some env variable (DEBUG?)
| image_path = attr_as_string(image_node, "image_path", &errors); | ||
|
|
||
| if (image_id == 0 || image_id >= MAPPING_SZ || errors) { | ||
| if (image_id == 0 || image_id >= MAPPING_SZ || !image_path || errors) { |
Contributor
There was a problem hiding this comment.
!image_path catches NULL, but the test fixture for sahara-empty-path.xml is created with image_path="" , so attr_as_string will return strdup(""), so !image_path is false and the empty path slips through. Can we check both?
|| !image_path || !*image_path ||
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.
No description provided.