Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux - Parity release - Harden pointer validation in several plugins and APIs #1557

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

gcmoreira
Copy link
Contributor

This PR is the last in the series related to fix the issues mentioned in #1516 and related tickets. Additionally, I fixed other potential issues I found with pointers.

fix: #1517, #1522

Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

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

All looks good except returning a blank string as an error indication. How would someone differentiate between a blank string, and the data not being present, or would it not matter?

txt = self._context.layers[self.layer_name].read(addr, length) # type: ignore
layer = self._context.layers[self.layer_name]
if not layer.is_valid(addr, length):
return ""
Copy link
Member

Choose a reason for hiding this comment

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

Would an exception or None not be better than returning a blank string? My concern is the string having a length of 0 or similar, and no indication that it failed otherwise...

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.

2 participants