Skip to content

Conversation

@ykaire-qti
Copy link
Contributor

Some device builds inlcude empty filenames. This change adds a check to handle that scenario and avoid segmentation faults.

Copy link
Contributor

@quic-bjorande quic-bjorande left a comment

Choose a reason for hiding this comment

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

Took me a while to figure out that we indeed have an issue here.

If the "filename" attribute is either empty or absent, attr_as_string() returns NULL, which will trip us on the strcmp() below. By including such details to your explanation, this would have been obvious - and I would have been more eager to merge the previous PR you had.

That said, what does it mean when a patch tag has an empty filename? Today we're crashing on them, with this change we're going to ignore them. But does the "filename" actually impact the patch?
Is it correct to ignore patch tags without filename, or is the "filename" attribute optional?

Copy link
Collaborator

@andersson andersson left a comment

Choose a reason for hiding this comment

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

s/inlcude/include/ in commit message.

Per my previous comment, I think it would be nice to change "handle that scenario" to explicitly state that we're ignoring those entries. (And I still would like to know if that is the expected way to handle this long term)

Copy link
Collaborator

@andersson andersson left a comment

Choose a reason for hiding this comment

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

Please run "make check" and make sure it passes cleanly.

Please also add a statement in the commit message, saying that this behavior aligns with how other Qualcomm tools handles this.

Some device builds include patches with empty filenames. This change adds a check to ignore those patches and prevent segmentation faults.
This approach ensures consistency with other Qualcomm tools, which also ignore such patches.

Signed-off-by: Yvonne Kaire <[email protected]>
Copy link
Contributor

@igoropaniuk igoropaniuk left a comment

Choose a reason for hiding this comment

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

LGTM

@andersson andersson merged commit 516a75f into linux-msm:master Dec 3, 2025
13 checks passed
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.

4 participants