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

Forbid headers with only a region #1495

Closed

Conversation

DemiMarie
Copy link
Contributor

Such headers are useless and might cause problems elsewhere.

Such headers are useless and might cause problems elsewhere.
@pmatilai
Copy link
Member

It's entirely legitimate for a header to be empty, region or no.

A package cannot have an empty header (or region), but that'd be a different kind of check.

@DemiMarie
Copy link
Contributor Author

We actually already reject empty headers (with no tags at all) in hdrblobVerifyRegion. So the only question remaining is if an empty region (ril == 0) is valid.

@pmatilai
Copy link
Member

Oh, right, I'd forgotten about that. That existing check is wrong in it's current habitat, it got moved around in the last big refactoring. A header is fundamentally nothing but an abstract data container, and being empty is an entirely valid condition for it to be in.

@DemiMarie
Copy link
Contributor Author

What about checking that a header/region is non-empty if (and only if) the regionTag passed to hdrblobVerifyRegion is non-zero?

@DemiMarie DemiMarie closed this Feb 19, 2021
@DemiMarie DemiMarie deleted the no-empty-headers branch February 19, 2021 09:21
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.

None yet

2 participants