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

core: Validate that xattr names aren't empty #3261

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

cgwalters
Copy link
Member

In the ostree-ext codebase the test fixture was generating xattrs without the trailing NUL byte. This caused confusing errors later. Change the dirmeta validator to catch this.

The way GVariant represents bytestrings, the trailing NUL is there on wire/disk so it can be there in memory too, but g_variant_get_bytestring() will just return an empty "" string if actually the value has a missing NUL.

In the ostree-ext codebase the test fixture was generating xattrs
without the trailing NUL byte.  This caused confusing errors
later.  Change the dirmeta validator to catch this.

The way GVariant represents bytestrings, the trailing NUL is there
on wire/disk so it can be there in memory too, but `g_variant_get_bytestring()`
will just return an empty `""` string if actually the value
has a missing NUL.

Signed-off-by: Colin Walters <walters@verbum.org>
@jmarrero
Copy link
Member

jmarrero commented Jun 4, 2024

/retest-required

Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@cgwalters cgwalters merged commit 8f559e9 into ostreedev:main Jun 4, 2024
25 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.

None yet

2 participants